First introduced in iOS 13, Apple has a feature in Settings called Silence Unknown Callers. If you routinely get a lot of spam calls then this is the feature for you.
Silence Unknown Callers
If you receive a call from a number that is not in your contacts, iOS will silence the call, send it to voicemail, and display it on the Recents list in the phone app. Incoming calls from your contacts, numbers you recently called, and Siri Suggestions will continue to ring.
- Open Settings.
- Tap Phone.
- Tap on Silence Unknown Callers and turn the toggle on.
If you place an emergency call iOS will disable this feature for 24 hours incase emergency dispatchers and first responders need to contact you.