You can use Silence Unknown Callers or a third-party app to block spam calls on your iPhone.
This is an article from Apple Support that I would like to share. Links contained in this post will direct you to additional Apple support posts. Hope this helps.
Turn on Silence Unknown Callers
With iOS 13, you can turn on Silence Unknown Callers to avoid getting calls from people you don’t know. This blocks phone numbers that you've never been in contact with and don’t have saved in your contacts list. If you’ve previously texted with someone using their phone number or if a person has shared their phone number with you in an email, a phone call from that number will go through.
To turn on Silence Unknown Callers, go to Settings > Phone, scroll down, then select Silence
Unknown Callers. Calls from unknown numbers are silenced and sent to your voicemail, and appear in your recent calls list.
Incoming calls will come through from people that are saved in your contacts list, recent calls list, and from Siri Suggestions to let you know who’s calling based on phone numbers included in your emails or text messages.
If an emergency call is placed, Silence Unknown Callers will be temporarily disabled for the next 24 hours to allow for your iPhone to be reached.
Before you turn on Silence Unknown Callers, make sure you have important contacts saved or you could miss a phone call that you don’t want to miss. The call will still go to voicemail and appear in your recent calls list, but you won’t get a notification when you get the call.
Set up an app to filter and detect spam calls
1. Go to the App Store and download an app that detects and blocks spam phone calls. You can download and install multiple apps with this feature from different app developers.
2. Go to Settings > Phone.
3. Tap Call Blocking & Identification.
4. Under Allow These Apps To Block Calls And Provide Caller ID, turn the app on or off. You can also reorder the apps based on priority. Just tap Edit and then drag the apps in the order you want them.
Phone numbers that appear under Blocked Contacts are numbers that you manually block.
When you receive a call, your device checks the caller’s number and compares it to the list of phone numbers in your third-party spam apps. If there's a match, iOS displays the identifying label chosen by the app, for example Spam or Telemarketing. If the app determines that a phone number is spam, it may choose to block the phone call automatically. Incoming calls are never sent to third-party developers.
If you determine that a number is from a spam caller, you can block the number manually on your device. Phone numbers that you manually block appear under Blocked Contacts.
If you no longer want to use the app, you can remove it.
Information about products not manufactured by Apple, or independent websites not controlled or tested by Apple, is provided without recommendation or endorsement. Apple assumes no responsibility with regard to the selection, performance, or use of third-party websites or products. Apple makes no representations regarding third-party website accuracy or reliability. Risks are inherent in the use of the Internet. Contact the vendor for additional information. Other company and product names may be trademarks of their respective owners.