The thing to remember is anywhere your tile comes into contact with another surface where there's a possibility that the surfaces can move around, you need to caulk it instead of grout it.
The first step is to remove as much of the old grout as possible with a grout saw. The saw has little carbide embedded chips that are very hard and sharp. Use a back and forth motion. The carbide saw does a good job cutting through hard surfaces.
Once it's clean, just take a soft, damp cloth to wipe away the debris. You can also use a toothbrush to get any stray particles out of the seam or grout joint. Now we're ready to apply the caulk.
Tile caulk comes in a variety of colors. Pick one that matches the color of your grout. Start in the corner and squeeze a little at a time. The next time the wall or counter moves, the caulking will move with it.
Finally, take a damp finger to remove the excess caulk and smooth it out.
So the thing to remember is wherever two surfaces come together around some ceramic tile, if there's any chance of movement, use caulk instead of grout.