Sex is a construct. There are different body parts, hormone levels, chromosomes etc and we try to use these to classify people but it's a flawed idea because of intersex. Rather than saying that male and female are sexes, try saying 'this person was designated female/male/intersex at birth based on how their body appeared'. Genders are man, woman, genderqueer, etc. Instead of saying people's genders 'match their sex, try 'this person's gender is the same as the one they were assigned at birth'.