A basic Spanish spelling rule: whenever you hear a nasal sound (m or n) before a p or b, you have to write m. For example, the first time you hear the word sombrero (hat), you might not be sure if you heard an m or an n sound before the b, but the rule tells us it has to be spelled with an m.
Un sombrero. -Listones. Mire qué listones más bonitos para que se haga unos moños.
A hat. -Ribbons. Look at what beautiful ribbons so that one can make some [hair] buns.
Caption 8: El Ausente - Acto 1 - Part 6
This rule must be applied without exception. When a word that ends in an n is combined with a word that begins with a p or b to form a compound word like cien+pies → ciempiés (centipede) the n becomes an m. Some other examples of this are en+pollo (chicken) → empollar (to sit on eggs, to hatch), en+bala (bundle) → embalar (to pack) and en+belesa (the belesa is a narcotic plant) → embelesar (to captivate).
Vamos a empollar veinte criaturas.
Let's hatch twenty children.
Caption 15: Calle 13 - Tango del pecado
Take note, this rule doesn’t apply to v, despite the fact that native Spanish speakers often conflate it with b. In fact, in Spanish, it is also a rule that you should always write n before v.
La gente no me parecía... no me parecía el tipo de gente con el que yo me quería involucrar.
The people didn't seem to... they didn't seem to be the kind of people I wanted to get involved with.
Caption 56: Arturo Vega - Entrevista - Part 2
This rule is very useful when trying to figure out the proper way to spell certain Spanish words, especially considering that it is not uncommon to hear native speakers replace the m sound with an n sound. Listen to our Nicaraguan friend, Doña Coco:
Y hay mucho cristia'... este... católicos también.
And there's a lot of Christia'... I mean... Catholics also.
Caption 26: Doña Coco - Música
Does it not sound like she might be saying tanbién, with an n, instead of también (also) with an m?
If you keep an ear out you are just as likely to hear anbiente for ambiente (environment) and inportante in place of importante (important). But remember, always write an m (not an n) before a p or a b, and an n (not an m) before a v.