How can you tell if you are a boy or girl?

Genetically, a boy has XY chromosomes and a girl has XX chromosomes (apart from some genetic disorders that you would probably already know about if you had them), so you can run a DNA test if that level of certainty is needed. Otherwise, a boy will have a penis and testicles and a girl will have a vagina (and ovaries inside).

Now, sometimes people are born with something called "ambiguous genitalia," and this means that they were born with genitals that didn't end up developing in the same way as most people's genitals do. In these cases, a DNA test should be done to make sure that you don't socialize someone to the correct sex. Some people are born with genetic conditions such as intersex (which used to be called hermaphroditism) or "disorders of sex development" (DSD). A doctor can go through the varies forms of DSD and help a person with a DSD to determine if they are a boy, a girl, or something in between or combined--and if so how to deal with that in a way that has a good outcome for that person.