My DSes are 5 and 2 - the two year old knows nothing about boys and girls yet, and DS1 was slow to pick up what the difference is (hair and eyelashes for years).
I don't let any remark about 'that's for girls' or 'that's girlie' go un commented upon - especially if it's from other adults in their hearing.
I don't police their cartoons (as long as age appropriate), although some of DS1's choices make me cringe a bit (Strawberry shortcake, Shimmer and Shine) - due to the plot lines (I delete any particularly awful ones).
DS1 and I have a running argument because I've decided that there weren't enough female dogs in Paw Patrol so I insist that Zuma is a girl (he tells me Zuma isn't and I make him try to justify why until he rolls his eyes and wanders off smirking at me)
DS2 is in a pink phase, so I let him have pink crocs, or whatever else he chooses - I feel myself gravitate towards a the traditional boy role toys (honestly, because that's what I'd prefer), but make sure that I step back and let them choose barbie or skylanders or whatever for themselves.
As others have said, there will always be outside influences. I try not to make a big deal, but always challenge and support (why shouldn't she play rugby? Of course you can have the purple one if you like, it's just a colour).
Once they're older we'll start working on consent (they're already pretty good kids - sharing, taking turns, looking after each other) and privacy (not an issue with DS2 who has always preferred clothes, DS1, not so much!)
I think that's all you can do. Model good behaviour, challenge biased ideas, and support their choices.