Several services can sex your plants pretty soon after they are big enough to take a piece off. Phylos starts at $15 a test. https://phylos.bio/plant-sex-test
I'm pretty sure it was mentioned in Ed Rosenthal's 'Marijuana Growers Hanbook', that male seedlings tend to be taller than the females just as they are when full grown. (the males are taller so that their pollen can fall onto the females) Using this method to thin seedlings has never led to a male showing up while flowering ..for me.