Cracks in brick mortar are expected after 20 to 30 years. Mortar doesn’t last nearly as long as brick, which can last hundreds of years with proper upkeep. For safety and the most cost-efficient solution, have a professional mason inspect cracks in brickwork. Most of the time, it’s cheaper to fix it early than wait until the problem gets worse.
Whether you need to clean bricks before repairing them depends on the problem. If they're dirty or growing moss and lichen and you're doing a simple repair job like repointing the mortar, cleaning the bricks is probably a good idea before attempting repair. However, if you remove the bricks to replace them with new ones, there's little point in cleaning the old ones.
You can prevent bricks from damage by properly grading your property and ensuring it slopes away from your house, regularly cleaning your gutters, and ensuring trees aren't growing too close to the walls and putting pressure on them with their roots. Also, regularly check the pipework that is affixed to the brick for leaks. Every decade or two, when the mortar is crumbling, get it repointed or tuckpointed to prevent further damage.