What do you mean "block them"? Block receipt of calls, message, email, etc? Or block you from sending anything to that contact?
Assuming you mean "block receipt from them" then the closest I can think of would be to use Do Not Disturb. You can set that to block calls/messages from everyone or make exceptions for "favourite contacts", so if you do not star/favourite those people you can block calls or messages from them. But I don't know how comprehensive it is: it will work for things controlled by system services, such as phone calls or SMS, but I'm sure there are message services it can't filter this way. And of course it is "block all except favourites" rather than "just block these people". But if for example it's to stop someone phoning you are 4am then sure, this will work: block all notifications and just allow a few (who you think would only call you in a real emergency) through, and then set this to turn on/off on a schedule.
Otherwise it seems pretty unlikely: different types of calls or messages are coming from different apps, so asking for one app that can intercept and filter all messages to all of these other apps sounds impossible (and if you could do it I'm sure it would violate Play Store rules anyway). To pick an example, if someone were to make a WhatsApp call to you that will be end-to-end encrypted, so no app other than WhatsApp will know who is calling. I cannot see any way that another app could filter such calls the way you want.
As for blocking you from contacting someone I doubt it's possible at all. The Contacts app doesn't own the contacts, it's just an interface to the contacts database (owned by the system Contacts Storage app), so even a custom Contacts app couldn't stop your phone/email/message apps from accessing those contacts. And that's what you would need. Now I think it's less likely that this is what you meant (it would seem a strange request), but it is a possible interpretation of what you wrote.