Hello, I'm a professional but sassy research geneticist who loves to post here on BnR and all over the internet in order to correct all the blatantly incorrect information I see floating around about biological sex. I want to equip you, the BnR reader, with these genetic facts so that when you go out into the world you can correct people just like me, BigDaddyScience420!
We start, as always, with humans and mammals who have an XY system with males being XY (heterogametic sex) and females being XX(homogametic sex). The mammalian Y chromosome originiated in the Therians, which is the ancestor to marsupials (mammals from australia with their young in pouches) and placental mammals (the ones that give live birth, nearly all mammals). That Y chromsome has been in use by therian mammals for 180 million years. That's how long we have been locked into our present XY system.
The next most close relative to the therian mammals are the monotremes(platypus and echidna, egg laying mammals). They have a poorly understood XY system with 5ish sex chromosomes supposedly. Having multiple sex chromosomes doesn't tend to be the most stable thing in the long term, it's probably not why there are only two species of monotremes left but it certainly doesn't help
From here its a very large jump into the reptiles (and fish) and we hit a whole lot of other groups at once so my ordering at this point is a bit arbitrary. So I'm going to just start with a common and ancestral sex determination system in reptiles and fish: Temperature. Reptiles and fish incubate their eggs externally and for many species the temperature they incubate the eggs at determines the sex of the offspring. It's probably not a coincidence that as mammals evolved to carry their young internally, they adopted an XY system instead!(the split between the ancestors to mammals and reptiles was 300ish million years ago).
Sometimes, a species can lose its Y chromosome entirely but manage to survive by switching to an XO system. An XO system has males with a single X and females are XX but the rest of the genome is diploid (two copies)
One group of vertebrates that are a bit different are the birds which have a ZW sex determination system. In a ZW system the females are ZW (heterogametic sex) while the males are ZZ (homogametic sex). On the surface, ZW and XY systems don't tend to actually have any large effects on the organism. You can't tell just by looking at an animal, it really only comes out of genetic analysis. There are some small genetic effects like the heterogametic sex tends to have more genetic diseases because heterogametic individuals are basically missing 90% of a chromosome but the effects of that are less than you might think.
Just like how the XY system can lose a Y and go XO, ZW systems can lose the W and become a ZO system. In ZO systems, males are ZZ and females have a single Z. Again the rest of the genome is diploid
So that covers the vertebrates, now we go onward into the rest of animals. Vertebrates are one animal phylum among 30ish other animal phyla and they use all the sex determination systems listed above plus a couple more
Some insects like wasps, bees, ants as well as other arthropods and various animals in other phyla use a sex determination system known as haplodiploid inheritance. This is probably my personal favorite system. In a haplodiploid system, the females have two copies of every chromosome in the genome while males only have one copy of every chromosome. This comes about because female eggs are eggs that have been fertilized by sperm to have two copies of every chromosome while eggs that never get fertilized become male. This has a couple of really cool side effects. One side effect is that females can actually choose the sex of their offspring. You see this in fig wasps where females will often lay one or two male eggs but then dozens of female eggs to maximize the number of offspring in the following generation. Another fun side effect of haplodiploid systems is that individuals who are sisters are 3/4 related to each other rather than 1/2 related like sisters in other systems. This may help contribute to the evolution of social behavior in these species
One final note on animals is that a lot of animals species outside of vertebrates and insects are hermaphrodites, having both male and female parts. Many can even mate with themselves! In some species hermaphrodites can choose to give birth to another hermaphrodite or give birth to just males to go mate with other hermaphrodites (or hypothetically females but I think that is rare)
Plants are very interesting because the vast majority of plants are hermaphrodites. Genetically, plants can use many of the mechanisms above plus some of their own. Hermaphrodites so common that plants that aren't hermaphrodites have a special name: dioecious. Dioecious species have male plants and female plants. People who are familiar with a certain recreational drug will note that it has separate male and female plants and the females are the fun ones. But the vast majority of plants are hermaphrodites that have a complex array of genes controlling flower formation. (here's an example if you want to know more https://en.wikipedia.org/wiki/ABC_model_of_flower_development) The female part is the carpel that leads to eggs and the male parts are anthers that make pollen, which contain sperm. Many plants have a unique feature called double fertilization where pollen actually release two sperm. One fertilizes the actual future plant while the other sacrifices itself and "fertilizes" a cell that doesn't leave any offspring in the next generation but instead grows into a really big food source (seed body) for the real future plant (seed germ)
Now for the fungi we have to practically abandon most of the above and start to get really weird. Forget about male and female, they generally are not a thing in fungi. Scientists generally classify the two fungi sexes as "A" and "alpha"(α). As far as I know, fungi don't tend to have any secondary sexual characteristics. All "A" and "α" do is mate with the other type. So to start with a simple fungi like yeast is single celled that is diploid (two copies of each chromosome). That diploid parent can make haploid(one copy of each chromosome) spores that are "A" or "α" that will then go mate with the other type. Multicellular fungi operate much the same way but they often make a mushroom or some such structure to distribute the spores. Another thing fungi do differently is that they don't always have a single nucleus like plants and animals do. In a lot of fungi every cell has two nuclei each giving out it's own commands. The two nuclei mainly interact when it's time to make spores and they recombine chromosomes with each other to make new combinations of chromosomes and genes. And of course fungi also reproduce asexually. If a clump of cells in the hyphae (the little threads underground) breaks off from the rest of the organism you just made a new organism! When you combine that with the double nuclei it gets very interesting when you try to define what an individual organism is. Fungi break all the rules