Any time you open a brake system to replace a hydraulic component, such as caliper or a flexible rubber hose, you introduce air into the brake lines, and that air has to be bled out by running brake fluid through the system, which carries any air trapped in the lines along with it.
If you’re never done it, bleeding brakes is, in theory, a very simple operation. At each wheel, there’s a bleed valve. On disc brakes, they’re on the calipers. On vintage cars with multi-piston calipers, sometimes each caliper has several bleed valves that you need to bleed in a certain order. On drum brakes, the bleed valves are on the wheel cylinders. In either case, you go to one wheel at a time in the bleeding order prescribed for your car