Here are some examples:
Adjective:
* The movie had a gritty realism that made it feel authentic.
* The city streets were gritty and dirty.
Adverb:
* She sang the song grittily, her voice raw with emotion.
* The soldiers fought grittily, refusing to surrender.