A hard reset is a digital "nuclear option," but for the SONY Xperia 1 IV, it is a safe and effective tool. If your phone is running hot, battery drains in 3 hours, or the camera app refuses to open, a hard reset will likely fix 90% of software-related issues.
If you don't want to lose your data but the phone is completely frozen, try a first. This simulates pulling the battery. How to Hard Reset SONY Xperia 1 IV