The iPhone 7 is the first version of the phone to use a stationary home button, so if it stop working, it can be a little scary. Thankfully, Apple built in a failsafe, so you can keep using your phone until you have time to go into the Apple Store and get it repaired or replaced.
As MacRumors poster iwayne points out, you might not actually have to do anything. If the phone detects that something is wrong with the hardware home button, it throws up a replacement software one on screen instead. Just carry on using it as normal (without the Touch ID feature, obviously).
If you don't see the message and your haptic home button has frozen, a hard reset might solve either or both problems, though Apple has changed the process for the iPhone 7 to take the home button out of the equation (in case it's the home button that's the problem).
On an iPhone 7 or an iPhone 7 Plus, you need to hold down the Sleep/Wake button and the volume down button for ten seconds or so until the Apple logo appears. At that point the device will reset and hopefully your problems are over. Otherwise, it's a trip to the Apple Store to try and get it fixed.
There's actually another long-standing option in the iOS accessibility options for dealing with a broken home button, and you can use this on older devices or if the iPhone 7 error detection doesn't kick in as tit should From Settings tap General then Accessibility and turn the AssistiveTouch setting to On. A new icon appears on screen.
Tap and hold on the icon to place it somewhere convenient on screen, then tap it once to bring up all the functions it can mimic, including a press of the home button should yours have become useless. You can launch Siri and the Control Center, and switch off your device (tap Device then long-press Lock Screen).