For most of the 40’s,50’s and 60’s one genre of movie dominated the USA’s film industry. This was the Western and it featured the adventures and escapades of the Cowboy. The Hollywood style of Cowboy was quite clean cut or a dastardly villain. The reality of the situation was that between the 1860s and 1890s, when the Cowboy was most numerous, it was a dirty, smelly and dangerous job. The only thing most notable of the Cowboy back then is that they made the t-shirt popular as an under garment. You can get much nicer ones, such as Farah T Shirts from https://www.ejmenswear.com/men/farah/t-shirt, in our modern world.
The Cowboy literally herded Cows. That was it. Their job was to move the huge herds of bovine and buffalo across the great plains of the West to feed the East. It was dangerous for a number of reasons. This was a lawless place and cattle rustlers were everywhere. Not only that, the Native Americans were sick of their land being taken and buffalo stolen so they occasionally looked to fight back.
Cowboys began to stop work by the start of the twentieth century. The West was no longer wild but properly populated. Sheriffs and Marshals were maintaining order and better fencing (which the Cowboys had put up) were being used to control the cattle.