There's the Western, a Hollywood genre with its own conventions and mythos.
Then there's real cowboys, who are still around. Come out and stay at a dude ranch and find out all about it.
http://www.albertacowboypoetry.com/
I might add that the Canadian cowboys were less likely to take the law in to their own hands. We had the RCMP out here for law and order. Infamous was Fort Whoop-Up, more along the lines of the American west, with too much alcohol and too many guns.