Just outside of Gadgetzan there’s an old, well dressed man by the name of Don Carlos.
When you compliment his hat, he mentions that years ago he would dual people for it. Anyone who could best him in combat would win his hat, but those days are long past and Don Carlos is now too old to fight.
Normally, this is where folks would give up. But luckily, the Bronze Dragonflight made the mistake of trusting you with the ability to step back into time to save Azeroth at critical points in history. Or in this case, beat up an old man.
Head over to the Escape from Durnholde dungeon in the Caverns of Time. The quest can be completed on either difficulty, but Don Carlos will also drop a toy that lets you wear the Sombrero over your regular hat at all times if you do it on Heroic. So heroic is the obvious choice.
Once inside, Don Carlos Patrols along the road you come across right at the start of the dungeon. He is accompanied by his pet coyote Guerrero. Attack him, and once he is knocked out, he’ll drop both the hat for the quest, and Don Carlos’ Famous Hat, which you can use at any time to equip the hat and summon the ghost of Guerrero as a non combat pet!
Head back outside and return to Don Carlos, he’ll give you his hat, and reveal to you that he was beaten once before, by you!
Congratulations, you have now created a time loop! Enjoy your hat!