PS4 freezing/slow

Hello guys I have bought a used ps4 a month ago. My PS4 just randomly freezes or slows down then freezes and when I turn it off then turn it on it takes me to safe mode. The only option that fixes it is initializing it then it works for few days and then it freezes again. I continue to initialize it over and over again and just want to know what is wrong with it.