Sex is a label that society gives a person based on the physical characteristics that they are born with. For example, chromosomes, hormones, and reproductive organs all contribute to determining a person’s sex.
Gender is a much more complicated topic than sex because it is rooted entirely in socially constructed concepts and expectations. The term gender refers to an identity constructed by the social norms and behaviors that society has come to associate with different sexes. For instance, many cultures have historically looked at people born with uteruses and given them the label "woman," which these cultures may associate with being more nurturing and inclined to participate in actions and behaviors deemed “feminine" by that given culture.
Society has historically assumed that a human being’s sex determines their gender, but that is not necessarily the case. For example, having certain reproductive organs does not necessarily make a person more inclined to align with the gender often associated with those organs. Gender is more about how an individual personally feels inside. For example, some people feel like their identity does align with socially constructed gender identities and expectations that parallel their sex, like people assigned female at birth who identify as women. However, it is also common for people to not feel like their gender identity parallels their biological sex, like with who were assigned female at birth who identify as men. Many people also do not feel like their gender fits in the made-up boxes of either man or woman and may identify as nonbinary, genderqueer, agender, or others.