Raise the back of your tongue to touch the soft palate. Add vocal cord vibration, then release.

Americans pronounce grammar as GRA-mer (/ˈɡræmər/). In "grammar", the "a" vowel before M or N raises and fronts toward [eə] — the tongue pulls up and forward, breaking the vowel into a tense glide as it anticipates the nasal. This is called the Cat-Vowel Before M/N, and it's one of the defining features of casual American English. It comes out as GRA·mer. Stress falls on the first syllable — keep everything else short and quick. You'll hear it in sentences like "She struggles with pronunciation but her grammar is excellent" or "The grammar rules in this language have many irregularities and exceptions" — more examples below.
Record yourself saying "grammar" and play it back. The mic stays on your device — nothing's uploaded.
2 syllables, 5 sounds. Tap a syllable to jump to its row, then explore each sound's mouth shape and how it's made.
Raise the back of your tongue to touch the soft palate. Add vocal cord vibration, then release.

Curl or bunch your tongue without letting the tip touch the roof of your mouth. Brace the sides of your tongue against your upper back teeth, and round your lips slightly.
Drop the jaw noticeably. Keep the body of the tongue low and forward, and don't let the back of the tongue raise toward the soft palate. Pull the lip corners back slightly, almost a starting smile.

Click any sentence to see the full breakdown — every link, every reduction, every flap-T.
The textbook way isn't wrong — it's just not how anyone actually says it.
In "grammar", the "a" vowel before M or N raises and fronts toward [eə] — the tongue pulls up and forward, breaking the vowel into a tense glide as it anticipates the nasal. The "/æ/" vowel raises and fronts before M or N — tongue pulls up and forward, producing a tense [eə] glide (between /e/ and /ə/). Not a pure /æ/.
Stress falls on the first syllable, not the others. Stretch GRA — keep everything else short and quick.
Americans use a relaxed retroflex R — the tongue curls back rather than rolling. The R is one continuous sound with the vowel before it, not two separate sounds.