It's kinda disturbing when people keep calling me during work or meetings, but to me it's okay if I receive short messages or Whatsapp message because I can reply them few minutes later in a short break. I'm new Android user and wonder if my phone could do that for me.
You can use the tried and tested
There, all incoming calls will be blocked. You may still be able to place calls unless you barred that too.
This feature is carrier network dependent and it already exists in the dumbphone era. Still useful though.
I also found Call Guard in the Play Store. Maybe you take a look at it.