If you are going to repair it, you may be able to splice the cord back together. This won’t work if the connector that goes to the laptop is broken but it will fix a damaged area of cord. In terms of doing the repair, refer to this guide if you are unsure of how to solder wires together. Don't get a cheap wire stripper either -- you will regret it. Get a good wire stripper and do it right -- they're not expensive. The cheap springless aren’t worth using for the price of a quality one.
What you need to do is find the broken part(s), cut them off (add +~1/2” additional cord for insurance) and then solder and heatshrink the repaired wire. NOTE: You may need to use Liquid electrical tape, since heatshrink has a bad habit of shrinking too early.
It’s up to you what to do this, but if you want a nicer look layer that sort of passes, layer matching length heatshrink that covers the area with a little overhang (and add a longer piece to cover the layered heatshrink to be sure). It won’t be perfect, but it'll help visually.
How I seal heatshrink is I use a butane torch using the least fuel possible - depending on the torch. I need to keep my small one (probably came from a smoke shop) cranked up because of a permanent clog since it had garbage butane -- Zippo butane helped revive it, but it was ruined in such a way it was permanently clogged. These are generally safer than the big ones that burn hotter and wider, with less error room to worry about - if this isn’t something you’ve done before you may want to use one of the smaller torches to get a better feel for how to do it properly. You can use a larger torch like the Dremel 2200-01 if you’re comfortable with such a thing, but it will burn significantly hotter. NOTE: The previous torch was subject to a CPSC recall Ronson Tech Torch
This is the butane I use since I can get it locally and it’s good quality. I have the Ronson equivalent (bought to preserve the Tech Torch warranty) isn’t as good with the same CAS#. I gave it a second chance with that Tech Torch and I didn’t like it even with a fresh can.