In modern English, you should use they/their, which is called "singular they." You heard correctly: you can use these when the gender is unknown or when you don't want to grammatically assign a gender.
Whoever wants to get their hair cut should come with me.
A good student does their homework.
No one forgets their own name.
It's common to find "he/his" as gender-unkown pronouns in older writing -- the older the more common -- but this is now decidedly out of favor.
One also occasionally finds "she/her" as gender-unknown pronouns. This was a trend that gained popularity in the age of gender bias recognition and awakening and is still followed, but "they/their" are quickly becoming most standard.