That is certainly true. To avoid gambling addiction it's important to keep yourself busy with other things. Don't think it's boring in the first place. It's not. Life is also gambling in a way, and if you look at it like that, you'll find all those attractions of gambling in your life too. Gambling also can take part in all that, but only a small part, not the main one.
Yes, instead of gambling, find another means of earning. If that person really aims to earn money and does gambling thinking that he or she could profit from it and doesn't do well, then I suggest finding another hustle like investment or trading. In that way, they could divert their attention to other things. I personally once experienced being a gambling addict and experienced a great loss, but when I realised that I divert my attention to trading, which is also hard but worthy, right now even if I do gambling just a little or a few times, I still have a decent way of earning. It is risky, yes, but it's more fine than wasting too much money on gambling. I only treat gambling as my hobby and make sure I don't go overboard with my gambling boundaries. So I agree to divert attention to other things instead of getting stuck in gambling and suffering more.
For the vast majority of people trading is no different from gambling. I know that many of those so called trading specialists on the internet want to convince you otherwise and even hope you buy their courses that are supposed to teach you how to trade, but the truth is that only a very small fraction of self-proclaimed traders are earning money with it in a sustainable manner. Investing maybe an option, but when we are talking about a person that needs monthly income to pay for all necessities like rent, food and health care, it doesn't make much sense to talk about investing at that point because that person has no spare money to begin with. The normal way for everyone to get started is to generate reliable income and then try to change something. That is why there is no responsible gaming in times of low budget life. The first thing to do is to increase a the sustainable income and then go from there.