On Android phones, under Sounds and vibrations, you can set your phone to 'Do Not Disturb' then under Custom settings allow calls from Contacts Only and messages from Contacts Only.
If you are applying for jobs or expecting calls from random numbers you can turn off 'Do Not Disturb' and get calls from everybody again.
I haven't had a home phone in 15 years so that's really the best way to eliminate telemarketing/robocalls.