XBOX One X Freezinging Up

I have an Xbox One X that is freezing up.
I replaced the hard drive and loaded a fresh OS and it will work for a day or two then it will begin freezing up again. I have reloaded the system 3 or 4 times already with multiple hard drives but it keeps freezing.

Also, when I try to shut it down the light will just start flashing and it won’t shut down.
I don’t know what else to try so hopefully someone can help me.