My HTC one m9 started to freeze on bootup. How do I fix this?

A

AC Question

I bought my m9 second hand. After using it for a few days it started to freeze on boot-up. So I browsed around for solutions such as clearing cache and resetting on recovery mode. Those solutions didn't work for me. As i was playing around the recovery mode i noticed the 1st line saying "Software status: Modified , ***unlocked***. Obviously this has already been tampered with. Foolishly I thought that maybe locking it can solve my problem. So now it says "***Relocked***" and my M9 is still not working! Is there anyway I can revert my phone back to the original software provided by HTC and hopefully make my M9 work again?