Prevention is the key. Once you give out your phone number or email address, it is being sold to the scammers. They spoof the sending number, so blocking them on your device has little benefit. If you have ever followed a link in a message, then it alerts the scammers that you may be susceptible to following their instructions, and that only means you will receive more of them. For SMS messages, most cell providers have Spam blocking available, and that is the best place to stop them from even being sent to your phone.
To help prevent exposing your email address, Apple has a service called Hide My Email, that allows you to create additional email addresses that can be used on third party sites, so your actual Apple ID used for Messages is not being used. This would be helpful for messages sent with iMessage to your account, but won't help with SMS messages.
What is Hide My Email? - Apple Support
There are apps available too, but I would not be the best source for any specific recommendation.