As one who took vocational agriculture for four years in high school (yeah, I was gonna' be a farmer), I can say I knew this, but not that I personally know how to do it. I bought pre-sexed chicks from a hatchery to get birds to raise as layers, and they are better than 90% accurate if I remember correctly.

It's a cruel business. Leghorns are (or were) the most common laying breed, and almost all the cockerels are killed because they don't grow fast or large enough to be good as fryers. Other breeds are used for fryers, used to be Cornish/White Rock crosses, that are good sized fryer birds in 8 weeks.

When I think back on the chicken biz days, yuck first comes to mind.

Sg