With iOS, you can block contacts and phone numbers on your device. You can also filter iMessages from unknown senders and report iMessages that look like spam or junk.
If you’re in the Phone app under Recents, tap the “i” next to the phone number or contact that you want to block. Scroll to the bottom of your screen, then tap Block this Caller.
If you’re in the FaceTime app, tap the “i” next to the phone number or contact that you want to block. Scroll to the bottom of your screen, then tap Block this Caller.
If you’re in Messages, open the conversation, tap the “i,” then tap the name or phone number. Scroll to the bottom of the Info screen, then tap Block this Caller.
When you block a phone number or contact, they can still leave a voicemail, but you won’t get a notification. Messages won’t be delivered. Also, the contact won’t get a notification that the call or message was blocked.
(This how-to is based on my experiences and info on Apple’s support pages — where the images sometimes come from.)