Summarize the following:
The flexible hose will most likely be a rubber hose (sometimes it may be braided steel) leading from the central brake line to the caliper piston in disc brakes or the wheel cylinder in drum brakes. To disconnect the hose, you should remove the retainer clip between the hose and the steel line. Next, you can turn the connector with a wrench until it comes loose. Do not crank too much on these connections. If you do you may bend the metal brake lines and then have to replace them as well. Instead, drain the line by cutting the brake hose and use a torch to heat the connection. This will break it loose and you can remove it. The brake hose may be mounted to the strut or another sturdy point between the central line and the wheel. You will need to locate any such connections by tracing the line from end to end. Loosen and remove any mounting connections you find. Now that the hose is disconnected from the lines to the master cylinder, you need only remove it from the brake itself. To do this you need to loosen the bolt found at the end of the brake line (known as a banjo bolt). This is often done with a 14mm socket or wrench, but the size can vary depending on make and model. There is also a washer on either side of the brake line (between the line and banjo bolt and the line and brake) that needs removed. To attach the new brake hose, you will simply reverse the steps you took to remove the original. This means putting the washers in first, then tightening the banjo bolt at the end of the brake  hose. First, attach the retainer clip. This holds the brake hose in place while you make the connection and is usually attached by sliding it into the appropriate holder at the end of the brake hose. Next, fasten the connector between the brake hose and lines leading the the master cylinder. This should be done with a wrench or flare nut wrench. You should also reconnect any brackets that hold the line secure (often found on the struts or other steering component). Bleeding the brakes is necessary to remove air that you have introduced into your brake line. Open up the bleeder cap found on the brake caliper or wheel cylinder and have someone pump the brake to force the air out of the bleeder cap. Wait until you see fluid coming out of the bleeder cap, and then close the cap. There are also pressure bleeders and gravity bleeders available for bleeding brakes.

Summary:
Disconnect the hose from the brake system. Remove any brackets or bolts along the flexible line. Remove the hose from the brake caliper or wheel cylinder. Attach the new hose to the brake caliper or wheel cylinder. Attach the new hose to the brake system. Bleed the brakes.