Getting them to break loose is the biggest challenge.
I use a good penetrate, soak them several times over 3-4 days, use high quality brake line wrenches to turn the nuts to prevent rounding the brake line nuts, as they are soft steel. Cheap brake line wrenches will round the nuts, buy good quality wrenches of the proper size, metric or american.
Use a wrench on the other side to help hold the line from twisting when using the brake line wrench on the nut side.
If the nut does not turn before they round, you will have to use a propane or oxy-acetelene torch to heat the nut very hot, let it cool and heat it again, do this several times to heat cycle the nut then re soak with penetrate in between cylces, then it should turn without rounding the nut. Heat may damage the flex line but may be the only way to break the nut loose, in this case replace the flex line, a casualty of war. Once the old line is off determine which flare type you have, nut type and line diameter.
Once you remove it you will have to buy some steel (not copper) brake line of proper diameter and cut to length with a steel tubing cutter, then slide the new nuts on first, then do a proper flare on both ends of the line, you will need to buy a brake line flaring tool, follow the instructions that come with the tool carefully. Steel brake line is fairly flexible but will kink if not careful when bending,
Parts stores here in the usa sell variable lengths of different diameter brake lines that are pre-flared with nuts included, just cut the length you need and reuse the nuts and re-flare as needed. You need to determine the diameter of the old line and type of flare nut needed. Sometimes the pre flared lengths have the correct nuts, sometimes they don't, nuts may have different thread pitches-diameters for the same line size, if you do not damage the old nuts they can be re-used.
There are two types of brake flares, inverted double flare (most common) and bubble flare.
To do a bubble flare you use the double flare tool but skip the last procedure that inverts the flare.
Brake line flaring tool kit:

Bubble flare, which can be done during the second step of double falring

Here are the three steps of the double flare, to bubble flare you skip step three, it takes some practice to do either flare correctly, buy extra line to practice until you are confident you have a good flare quality.

High Quality Brake line wrenches for best results.
.
