Cowboys originated in Mexico.
When the spanish conquerors arrived, they started stablishing ranchs and farms, and the role of the vaquero (from the spanish word vaca) was coined to name the men who took care of the livestock, and who were also good with certain skills like herding, roping and riding.
As the ranching practices were spread, so did the culture of the cowboy, including their clothing style and their skills.
The first cowboys had different backgrounds like Mexican, Native American and African American, among others.