Google Pixel devices ship with the Flip to Shhh feature that lets you flip your phone face down to put it in silent mode. You can enable this setting from Settings > System > Gestures.