What do you mean by "accents"? Written Latvian does not include accents as in the majority of cases the stress falls on the first syllable. There are regular exceptions that are easily to learn, e.g., the superlatives with the prefix vis-retain the original stress and a few irregular exceptions (labdien – with the stress on the second syllable).
Maybe you meant letters with macrons (ā, ī, ū, ē) that indicate vowel length and cedillas (ķ, ģ, ļ, ņ) that indicate palatalized pronunciation. They are never optional unless not available due to technical reasons.
The important thing is to know that long Latvian syllables (long vowel or syllable ending in n, m or l) are pronounced with a certain pitch accent. It is different from the syllable stress although for educational purposes they can be thought as a peculiar secondary stress. This is more complicated than most native speakers realize. Due to orthographic tradition the pronounced long vowels are not always marked with macrons, especially in loan words. Just recently I realized that the loan word cunami (tsunami) is usually pronounced in Latvian as cunāmī with a sustained pitch.