Asking kindly with なさい and prohibition with な

なさい asks someone to do something. It feels as though the asker expects the listener to do the action, but it's still a kind request. It has a feeling of indirectness/softness and can be often seen as feminine although it’s still fairly gender neutral. The speaker is usually a higher rank than the listener, and it is common among teachers and mothers when telling off kids. You can also find it in common set expressions like おやすみなさい, in which case there’s no extra nuance attached.

聞きなさい
Please listen.

食べなさい 
Please eat.

Finally, we get to な used to indicate prohibition. It attaches to the end of a statement without ます and without past tense. This sentence-ender can be confused with the な sentence ending particle mentioned in Lesson 29. Context and tone will tell you which is which. They are very different.

来る!
Stay away! (Don't come!)

Note: The さい part in なさい is also commonly dropped. You can easily distinguish it from the prohibition な because it attaches to the masu stem of the verb:

聞き
Please listen

聞く!
Don't listen!