What you can see
Cracks or crazing in the rubber, bulging under pressure, a wet trace or fluid seepage at the fittings: all justify replacement.
What you can feel
A soft or sinking pedal, a vehicle that pulls to one side when braking, or a brake that stays tight after you release the pedal. A hose damaged inside can let fluid through in one direction only.
Replace in pairs, then bleed
Replace the hoses on the same axle together, then bleed the system to remove air. Use the brake fluid type listed in the owner's manual.
Choosing the right hose
Length and fittings vary by vehicle, and between front and rear, left and right. Pick the year, make and model to see only compatible hoses.
This advice is general. If in doubt, have your brakes inspected by a mechanic before driving.