Part of it depends on where you buy them and what you buy. There are some pretty easy ways to sex certain chicks at hatch, but the parents have to be set up genetically for that to work. Some breeds are auto-sexing (you can tell the sexes apart at hatch) but that is very few breeds and some of those require judgment or experience. Some cross-breeds can be sexed at hatch by down color or some other markings. The first post in this thread goes into real good details on how some of that works.
Tadkerson’s Sex Link Thread
https://www.backyardchickens.com/forum/viewtopic.php?id=261208
Hatcheries have people specially trained to vent sex chicks. Most of those won’t even try bantams because they are so small, but by looking inside the vent and knowing what you are seeing most of them guarantee an accuracy rate of 90% or more. They are not perfect but they are pretty good.
All that is chicks that have just hatched.
As they grow chicks start top develop differently based on sex. This is going to vary depending on breed and the individual chick. There is a long list of things that could be used to help sex the chickens. Some start to kick in pretty early. Often by five weeks you can tell whether most chickens are male or female, but with some you may need to wait until four or five months to be sure. Some breeds are a lot easier than others and some chickens within the breeds are easier than others. It usually makes it easier if you have other chicks of the same breed to compare them to. It’s generally easier to say that a specific chick is definitely male than to say that one is definitely female at a young age.
Some things to look for:
Body conformation and posture. Chicks that stand more upright and have longer heavier legs are often male. Some males develop an attitude early but a lot don’t.
Combs and wattles that grow early and turn red early are usually male.
When they hit puberty saddle and hackle feathers on males grow longer and are pointed. Females have shorter more rounded saddle and hackle feathers.
In some breeds male feather patterns are different than the female. Wings are often a different color or pattern. Tail feathers grow in differently. Females are often more straight while the male feathers tend to curve.
Eventually males will outweight females of the same breed.
There are others. Whether they crow or lay eggs is a dead giveaway but many of these are just clues. You often have to see the entire package to be sure.
One way to get all females is to get POL (Point of Lay) pullets. These are normally about 16 weeks old and not that far off from laying. Usually by sixteen weeks you can tell sex at a glance. Usually.