This wikiHow teaches you how to prevent callers with unknown numbers or those not saved in your contacts list from reaching you on iPhone.
Step
Method 1 of 3: Using the Do Not Disturb Feature

Step 1. Open the iPhone settings menu (“Settings”)
This menu is indicated by a gray gear icon that appears on the iPhone's home screen.

Step 2. Touch Do Not Disturb
It's at the top of the menu, next to a purple icon with a moon in it.

Step 3. Touch Allow Calls From
It's in the center of the screen.

Step 4. Touch All Contacts
This option is in the " Groups " menu section. Now whenever the Do Not Disturb feature is activated, only the numbers stored in contacts can reach you.
Swipe up on the home screen or lock page and tap the circle icon with the crescent moon at the top of the “Control Center” window to turn the feature on or off Do Not Disturb.
Method 2 of 3: Blocking Calls Labeled As “Unknown”

Step 1. Open the Phone app
This application is marked by a green icon and is displayed in the lower left corner of the device's home screen. Inside this icon is an image of a telephone receiver.

Step 2. Touch Contacts
This option is in the lower center of the screen and contains a human silhouette icon.

Step 3. Touch +
It's in the upper-right corner of the screen.

Step 4. Type "Unknown" into the first and last name fields

Step 5. Touch Save
It's in the upper-right corner of the screen.

Step 6. Touch Block this Caller
It's at the bottom of the screen.

Step 7. Touch Block Contact
Now most calls labeled as "Unknown" will be blocked from iPhone.
Friends who call you via unknown numbers cannot reach you
Method 3 of 3: Blocking Calls from Unknown Numbers

Step 1. Open the Phone app
This application is marked by a green icon and is displayed in the lower left corner of the device's home screen. Inside this icon is an image of a telephone receiver.

Step 2. Touch Recents
It's a clock icon in the lower-left corner of the screen.

Step 3. Touch next to the number you don't recognize
It's a blue icon on the right side of the screen.

Step 4. Swipe the screen and tap Block this Caller
This option is at the bottom of the menu.

Step 5. Touch Block Contact
Now calls from that number will not be accepted by the device.