Contacts app -> Menu -> Settings -> Import
Check your guide for exporting contacts to a VCF file wherever you used it. For a stock Pixel this is the guide:
https://support.google.com/contacts/answer/7199294
Copy the VCF file over to your new phone and import it from there. You can plug your pixels together with a USB cable or do over a PC or whatever else you prefer.