There are a variety of ways ranging in price from reasonable to free. 3rd party boxes, phone systems (landline and cellphone) with blocking built in, computer apps
Do a web search and keep an eye out for "First Ring Suppression." Your phone must ring the first time to ID the number which is then blocked or allowed. FRS silences that first ring on all calls. If a blocked number calls, the phone lights up, reads "caller blocked," goes dark and never a ring is heard.
You must have the feature from the phone company.If you have it,dial *60,listen to the instructions will tell you everything about the feature. Or call and add to your phone service.