Sex is what you are, male or female. Defined by chromosomes, you're either XX or XY. (a few defects cause others, but those are rare and still male/female specific.
Gender is language construct. Masculine, feminine, and neuter. Some also include animate/inanimate. And a few rare ones have even more:
https://en.m.wikipedia.org/wiki/List_of_languages_by_type_of_grammatical_genders. But, these are still only grammatical constructs, not biological facts. The issue for many Americans is that English doesn't really use gender. Nouns are all neuter, 'the' is used as the article. Pronouns like 'his' or 'her' are the closest thing we have to gender, but those refer to the object's sex. Not any gender of those noun/pronouns. The canard that sex and gender are the same thing is a new misrepresentation of language used to try and confuse the general populace.