なさい is the 命令形(めいれいけい) (imperative form) of なさる, a 尊敬語(そんけいご) (honorific language) verb which specifically highlights and respects the actions of another person (never the speaker).
Despite being respectful, the fact that this is a ‘command’ means that it would never be used toward a superior. Due to this,
なさい is most frequently used toward peers, or people of lower status, like children.
To use
なさい, simply connect it to the ます stem of any verb.
なさい may be shortened further to な, which becomes an even more casual form that is used most frequently toward peers.
Be careful not to get confused between な (the particle), and な (the shortened form of
なさい). These can seem very similar, but な (meaning don’t) will always be used with the dictionary form of a verb, while な (meaning please do) will always be used with the ます stem of a verb.