Xbox One X slow startup times and random freezing

Over the past few days my Xbox One X has had a range of problems including taking around 5 mins to start up as well as randomly freezing during games and just using the menu, sometimes becoming unfrozen after 10 minutes or so. I have reset the system in every possible way and every time the issue has disappeared temporarily before coming back. Any ideas as to why this might be happening?