When talking about commands, we talk about the imperative mood. We use this mood when telling someone to do something in a direct manner. Put another way, sentences in the imperative mood are commands. So the correct formal command is tenga cuidado. So this is when you address a person older than you, or your boss, your teacher, among other people.