IPA: /ɡrəˈmætɪkli/
KK: /grəˈmætɪkli/
In a way that follows the rules of grammar.
She spoke grammatically correct sentences during the presentation.
Grammatically → It is formed from "grammar" (from Greek "grammatike", meaning the art of letters or writing) and the suffix "-ally" (meaning in a manner of). The word "grammatically" means in a manner relating to grammar or the rules of language.
Think of the art of letters ('grammar') and how 'ally' means in a manner of — so 'grammatically' refers to how something relates to the rules of language.