This troubleshooting article walks through steps for iPhones with different button types (Face ID, Home Button, etc.), including how to enter recovery mode, erase your iPhone, restore it from backup, and recover access to your Apple ID if necessary.
support.apple.com