They can be interchangeable.
"You need to calm down." == "You need to cool down."
"We'll talk when you calm/cool down."
"Calm down!" is a bit more intense than "Cool down!"
"Calm down" is more popular. I think "cool down" sounds a little less formal.
We often say, "cool/calm [someone] down" when we are referring to making that person less emotional.
"Take a walk and cool yourself down."
"This piece of cake will calm you down."
You can also say "cool off" and use it in th ways described above.
"Take a walk and cool yourself off."
"Take a walk and cool off."
(Just to be thorough, "calm off" can NEVER be used.)
"Cool down" or "cool off" can have other more literal meanings
"I fanned myself to cool down." Here, you literally wanted to lower your temperature.
It is also a term used in exercising. In this case it refers to doing some less intense exercise to allow the body to return to a resting state or to lower its temperature.