Sex is biological, gender is psychological.
Sometimes people have surgeries and hormone treatments to make their sex sync up with their gender. Sometimes people are forced to go to therapy in an attempt to make their gender sync up with their sex. See what I’m sayin’?