While watching TV with my kid, I've watched various advertisements of gambling nature (let's say for example, Rummy123, RummyCircle, A23 Rummy, etc.)
These are all specifically Indian ads, but I'm sure you may have seen various gambling advertisements, some banners at boundaries when cricket is ongoing, even in any other sport. How would a kid ignore those things, they might just come and ask you about what is it. Till when can we lie to them? Don't you think that the frequency of such ads must be less in order to let the kids not get trapped into gambling and don't do it at such a small age?
The best way to help a child or children not to begin associating themselves to gambling and other social media stuff is not to watch those things in their presence, I understand that when it comes to ads it may just pop up abruptly while in the midst of educative TV show in form of ads but you can totally avoid tuning into such stations that it could be aired as ads, of course we can identify such stations and programs, like some TV shows that involve immoral acts are likely to also show some gambling ads because they go hand in hand.
You can't see a religious TV show or program running gambling ads on their program, so those are more apt for children, cartoons and kiddies shows. Some kiddies by themselves detest to watch any TV that is not kiddies or cartoons. So don't force them to watch those not good for their character formation.
Gambling is a big business for owners of game houses and casinos so they are surely going to have their ads littered everywhere in social media, apps, radio or TV stations and it is the duty of parents to guide their children properly until they are of age to take their own decisions.