The purpose of the French diacritic actually varies depending on which one you're speaking about!
One of the most common diacritics is the accent aigu, or é, most commonly at the end of words. This diacritic indicates pronunciation. "é" is always pronounced as "ay."
Other diacritics exist as hallmarks to letters that used to be a part of the language. The circumflex accent, ô, ê, í, etc, indicates that an 's' used to follow the vowel. So "hôtel" used to be "hostel" in old French.
Accent grave, à, ù, etc, does not typically indicate changes in pronuncation, but is important in distinguishing the meaning of words. For example, "ou" simply means "or," whereas "où" means "where."
You can see that some accents are more useful to daily use than others, but as a rule of thumb, I think it's best to never omit them, especially in formal writing.
Hope this helps!