Whenever you hear the National Anthem, wherever you are:
- Stop and stand at attention
- Face the flag, or if you can't see the flag, face the source of the music
- Remove your hat
- Place your hand over your heart
Here's the official United States Flag Code:
"During rendition of the national anthem when the flag is displayed, all present except those in uniform should stand at attention facing the flag with the right hand over the heart. Men not in uniform should remove their headdress with their right hand and hold it at the left shoulder, the hand being over the heart. Persons in uniform should render the military salute at the first note of the anthem and retain this position until the last note. When the flag is not displayed, those present should face toward the music and act in the same manner they would if the flag were displayed there. "