Before you wear them: the step almost nobody takes
Ideally, you should protect the sneaker before wearing it for the first time. Applying a waterproofing spray suited to the material creates an invisible barrier that repels water and slows dirt from settling into the surface. It's a two-minute gesture that makes the difference between a shoe that ages well and one that stains at the first opportunity.
It also helps to avoid wearing them for the first time on rainy days or on muddy ground. There's no need to be extreme about it, just give the waterproofing treatment time to do its job before exposing them to the most demanding conditions.
