The language and instructions used leads to developing expectations. Modeling is also important. They learn by comparing themselves to others. Once gender is viewed as permanent, they strive to act role to provide internal congruence. Parents or primary caretakers model and reinforce gender roles.
Fathers are more likely to pressure children into gender roles.
There are several methods used to socialize children into gender roles. They often advise different courses, assign different tasks, and reinforce gender stereotypes. Sex education in school when it does occur does not seem to affect levels of sexual activity, but it has repeatedly been shown to reduce incidence of STDs and unwanted pregnancies. Teachers or anyone for that matter are better sex educators, if they have certain qualities. They need to have a comfortable attitude about sex , so they are open to questions.