Giving orders is another obligatory use, with one exception covered below. Build the ordinary form and then switch the vowel.
no te quedas (you don't stay) → no te quedes (don't stay!)
No hables · No te quedes aquí · No lo des · No se lo des · No los esperen · No lo coma · No lo comas · No lo coman
Coman · Esperen · Coma · Compren lo que falta
The one place the position rule inverts. With positive commands, telling somebody to do something rather than not to, the little words attach to the end of the verb, written as one word.
Espérenlo · Espérenlos · Cómalo · Cómanlo · Olvídelo · Olvídese
Telling people informally what to do is such constant, everyday speech that the mood tense felt too heavy for it. So Spanish took a shortcut: drop the s from the informal you form.
compras → drop the s → compra
That makes it identical to the he/she/it form, but it causes no real confusion: your tone of voice and the context are always present, and the little word on the end marks it as an order.
Cómpralo · Cómpramelo · Olvídalo · Olvídate · Cómelo · Véndelo · Cállate
Think of it as taking off the s, so you keep the association with informal you.
The shortcut is only for positive commands. Make it negative and you need the mood tense again.
Véndelo but no lo vendas · Olvídalo but no lo olvides · Cállate but cállense (plural, so mood tense)
The "we" form of the mood tense gives you let's.
No lo olvidemos (let's not forget it) · No nos olvidemos (let's not forget)
Olvidar is a verb that does not like to be alone: it wants you to say what is forgotten. So lo olvido is fine, but for a bare I forget you need me olvido. You can also use both: no te lo olvides.
No se olviden · No lo olviden · Compren lo que hace falta