Sorry to say, but HP has never exactly been known for making quality computers, and it sounds like your drive is slowly dying.

If the system is still under warranty, try and get a replacement drive out of HP. That will probably at least buy you some additional time before it happens again.

If it's not, you can try trolling ebay, looking for someone selling a broken laptop for parts, or any other drives that may work in that laptop.

Simple reality is that optical drives wear out a lot quicker than most people would ever imagine.