Quick answer
Perfective = do this one thing now: Скажи́! Imperfective = invitation, repetition, or getting on with it: Говори́! A prohibition is nearly always не + imperfective.
Side by side
Invitations are imperfective
This is the one that surprises learners: a host says Сади́тесь! and Бери́те!, not the perfective. The imperfective sounds welcoming; the perfective sounds like an instruction.
Prohibitions
“Don’t do it” is не + imperfective: Не звони́ мне, Не открыва́й окно́. The perfective after не means a warning: Не упади́! — “don’t fall!”
The short version
One specific action → perfective. An invitation or a warning → imperfective. Prohibition → не + imperfective.
Typical mistakes
Сядь! to a guest
Сади́тесь!
The perfective sounds like an order to a dog.
Не откро́й окно́.
Не открыва́й окно́.
Prohibitions take the imperfective.
Check yourself
A host invites you to sit down. What do they say?