Brick and mortar is a solid building material, but it won't last forever. Here are the basics for "tuckpointing", the process of repairing and rebuilding a brick wall.
The mortar and cement holding together a brick wall will erode over time, especially if they're exposed to water for extended periods.
First, remove the compromised mortar using a chipping hammer, or a hammer and flat chisel. For larger jobs and harder mortar, you can use an angle grinder with a diamond blade to make relief cuts in the center of the mortar. This will make it easier to chip out the remaining mortar.
Next, apply mortar mix between the bricks using a brick trowel and pointing trowel. Start with the horizontal joints first and make sure the mix is packed tightly.
Finally, match the look of your new joints to your old joints. In a flush joint, the mortar lines up flush to the edge of the brick. In a raked joint there is a quarter inch relief in the mortar below the edge of the brick. There are other joint profiles but these are the most common.
Before starting any brick repair, check to make sure your wall is not of historical significance. Preserving classical masonry is best left to professionals who understand how to restore -- not just repair -- these types of walls.
How to Repoint Brick Walls [DIY Doctor (YouTube)]