Here's how to block or reject calls to voicemail on your Pixel 2 / 2 XL.
Tap the
Menu icon

then tap
Settings
.
Do any of the following:
Add Block
Add the number to be blocked.
Tap
Block
.
Calls and messages from contacts or phone numbers added to the block list are automatically ignored. The call is forwarded to Voicemail and text / picture messages aren't delivered to the Messages app.
Remove Block
Tap the
Remove icon

to the right of the blocked number.
If calls from a specific number go directly to Voicemail but you're still able to receive text messages, ensure the contact isn't set to automatically route to Voicemail by navigating:
Contacts
, select the contact, tap the
Menu icon

then tap
Unroute to voicemail
.