Usually not completely. Once your number/address is made available to the spammers, you will get those and they spoof the sending number so even by blocking, the next one will come from a different number. There are Spam blockers available that may help in some cases. Check first with your cell provider as most have services to help. In some cases, they just need to be turned on while others offer a subscription service. There are also 3rd party apps in the App Store with most being a subscription service.
You will get more of those messages if you respond or click a link in the message as that alerts the spammers that you are susceptible to believing what they say and your number is more valuable to them.