You never mess with another man's cowboy hat, horse, truck, or his woman...
Your hat is always removed during the passing of the flag, a casket, the playing of the National Anthem, & during the Pledge of Allegiance. While in church, and during prayers.
When you are introduced to a woman, a clergyman, or an oldster. When dining in a restaurant, and when entering a home.
You remove your hat by the crown, never the brim. You never rest it on it's brim. It is put on a hat rack, or rested on it's crown with the brim up.
Always tip your hat to a lady, holding it by the crown, but never another man.
Moms have been teaching cowboy hat rules to their sons and daughters for years. A simple sign of respect and manners.