To take a screenshot on a Pixel, you'll need to press the power button and the volume-down button at the same time. This will capture a screenshot of your current screen, which you can then find in your Photos app. You can also edit and share your screenshots from there.
The process is the same across most Pixel devices, including the Pixel 3, Pixel 4, and Pixel 5. Just make sure you're pressing the buttons simultaneously, and you'll hear a camera shutter sound to confirm that the screenshot has been taken. If you're having trouble, try pressing the buttons at the same time and holding them for a second or two.