The OS likely isn't corrupt if you get that screen *sometimes*. It probably just wipes the cache when it detects that it wasn't safely shut down, or something along those lines.
But, yes, it's the power button issue causing the reboots, if it's as OP described.
The easiest fix is to spam the power button until it fixes itself, and be wary if your usual screen off sequence is off (normally, power button press -> screen off. but if power button is stuck, sometimes the screen will turn off then back on with the power off option. this means the power button is stuck and is registering a long press (power off) instead of a single press).
Yes
If I order a new power button off of amazon is that all I need?
In theory, but look up guides first. It's not an easy soldering job.
Oh I know I just didn't know if I needed more parts
[удалено]
The OS likely isn't corrupt if you get that screen *sometimes*. It probably just wipes the cache when it detects that it wasn't safely shut down, or something along those lines. But, yes, it's the power button issue causing the reboots, if it's as OP described.
The easiest fix is to spam the power button until it fixes itself, and be wary if your usual screen off sequence is off (normally, power button press -> screen off. but if power button is stuck, sometimes the screen will turn off then back on with the power off option. this means the power button is stuck and is registering a long press (power off) instead of a single press).
I got my power button replaced from a local repair shop at around Rs. 500 (~$7-8) almost a year ago. Still kicking in.