Writing systems

What is a common function of a diacritic in an orthography?