You can reduce the number of unwanted text messages you receive when you block individuals, filter unknown senders, and report spam or junk messages.
Note: A known sender is anyone you’ve added to the Contacts app or sent a message to.
When you block a specific contact or phone number, messages from that person or number aren’t delivered. (The person sending the message doesn’t know that their message was blocked.)
Go to the Messages app Filter messages from unknown senders, above.
Go to Settings Apple Messages for Business & Privacy.
To learn about other ways you can report and prevent unwanted messages, see the Apple Support article Recover deleted messages in Messages on iPad