No, it won't. That's a pretty dumb mindset to have ngl, Yes, it might remove him from his addiction from gambling, but it doesn't really solve the root problem since drugs would simply replace the void that was opened up due to forgetting about gambling. I honestly would recommend getting another hobby instead, maybe Gundam building, jogging, biking, idk. it may seem more expensive than gambling, but I'd honestly say it's a lot better since it wouldn't turn into an addiction, unlik gambling.
The better way indeed is to find another activity that will freshen up his mind. But with the situation in most countries, it is still hard to move around why a lot are still preferring to stay at home. And you can only do much when you are inside. Maybe as a start, he needs to see a professional doctor, and asks his situation. Being in the depressed mode or with this anxiety thing is very hard and most of the time, you can't manage it on your own.