if growing regular photoperiod strains, preflowers would be the earliest point to tell...
You could also grow out plants in veg... and take a clone from one, then put the clone into 12/12 to force flowering, just to see what sex shows up, then you know what the mothers sex is, and you can continue to grow in veg without ever having to transition it. (until time to flower)
You could buy feminized seeds if you dont want to waste any time growing out males *(not 100% perfect... close to it though, fem seeds are great imo)*
Most people just wait to preflowers to show, then cull males from there. It can be a waste of time/space/nutrients/soil/plant count/canopy size/etc. But it is what it is.. Many people will grow extras for this reason.
I just normally get lucky and get mostly female, I also will run a certain number of fem seeds per year to sort of guarantee at least a few females.