Those scammers are very professional in this kind of thing, as this is their job. By the way, there are communities of people who have set up offices to run their scams and you'll notice that it's a lot of people scamming people, especially older people which are generally their preferred targets.
Many such groups operate out of India and other South Asian countries. There are great videos online of people hacking those scammers and destroying their operations. It's great to watch when they start to panic, seeing everything get destroyed.
We can't really avoid them easily since they change their strategies and methods every now and then.
You can always avoid social engineering scams. Phishing, for example, isn't hacking. People become victims of traps and unknowingly hand over account access or other sensitive data. It's not difficult to learn not to do that.
In my opinion, the best thing to do is to never click on any kind of links even if it seems like a legit one...even if it's from a family member or close friend as well to avoid scams and phishing. We should be more careful, especially with everything we can now access online.
Although that is true for phishing, what I described in the OP is different. Here we have an example of a technique where victims destroy themselves, thinking they are creating a gold mine that will earn them a lot of money.