Two of the most common hardware issues with the iPhone are failures related to the Home button and Power button. This can present as either of these buttons becoming hard to press, not reading presses at all, or they can intermittently work. If you aren't up for a Home button or Power button DIY repair to fix the issue permanently, there is a way around them by using the Assistive Touch accessibility feature. This will give you a virtual Home button and Power button that can supplement the hardware. It isn't the most ideal solution but if you need a quick one, this is it.
You'll now notice a white dot appear on your screen that will remain there. You can tap on this to expand the Assistive touch menu. The Home option will allow you to tap it in the place of a physical Home button and be returned to the Home screen from wherever you are. To access the Power button function, tap on the Device menu and then tap on the Lock Screen icon and your screen will shut off.
While Assistive Touch isn't the perfect solution, it can definitely make your iPhone functional again until you can either get it repaired or get a replacement.