Chosen Solution

So, my display on my MacBook would randomly go to black and and I believe the problem comes from a damaged flex cable. How can I replace it?

Before jumping to the wrong conclusion, how about fully diagnosing the problem first. I would start off using a flashlight shining it into the display. You’ll need to hold the flash light on the glass at a sharp angle to hopefully see the faint image of your desktop and icons. Do you? Using an external monitor are you able to see the desktop and icon’s when the internal display goes out?

Does the screen randomly go to a lit up black screen? There is a common CPU issue on these where it will usually do that and restart, sometimes showing some pixel width slightly diagonal lines going down the screen. To replace the LCD cable (not guaranteed to fix your issue), follow the below guide. Step 28 shows the LCD cable (unscrew the PCB and it unplugs from the other side), you can ignore a lot of the steps before this (removing the audio board, etc) since you don’t have to remove the whole assembly. Retina MacBook 2015 Display Assembly Replacement