When they want to slow down, they extend their extremities. Your pivot works the same way although normally you will only make a 90 to 270 rotation when you pivot. When you pivot collapse that leg inwards and then expand it outward to regain a stable position at the completion of the pivot. Keep your upper body as straight as possible when you pivot. In other words keeping your back relatively vertical will help you keep your head from moving outside your base of support.
Most players use the head swing method of pivoting because it's physically the easiest.
Always pivot slightly into the defender when squaring up to the basket. When you pivot away from a defender you must be able to pivot back to the basket with balance. Most young players step back when pressured and put themselves into a position with no balance or strength to step back into the defender. Always pivot into the defender but with balance. When you must pivot backwards, pivot low ready to make a 180 down and back toward the basket when pressure comes.