How can I reinstall the OS on macbook pro?

Solution 1:

May be your internal SSD is "broken". So, from Internet Recovery Mode, you install Mac OS X on an external drive and boot from it.

You can hope to recover data on the internal SSD (the ideal being to make regular backups with Time Machine).

Then if you are lucky enough to have an unsoldered SSD, which seems to be the case with the 2015 MBP, all you have to do is replace this SSD with a new one.

The 2015 MBPs accept NVME SSDs (much cheaper than original Apple SSDs) with a specialized adapter.