People go to special school to learn to vent sex; it's a real art. Depends on the breed. Some can be color sexed at hatch to a degree of certainty. Some you just have to wait for the combs to get red or other secondary sex traits to show in a few weeks.
I read once that you could sex them by the first real feathers on their wings....something about the size and development of the first four primary feathers can show if they are a roo, or something of that nature.
I did a blog post on this not too long ago that shares how to sex an old-timers way. I heard from others that it is 95% success rate. I just started sexing this way myself so time will tell.