Here's a step-by-step D.I.Y. tutorial on How to grout wall tiles which will be the same process as floors. Some other D.I.Y tutorials that you might find helpful are How to freshen up grout and Grout cleaning tips and tricks.
I was advising my sister on this question recently and was telling them that they needed 3mm of depth otherwise the new grout would just fall out. But… Davco has a product, which we sell called Rejuvenation Grout. It comes in about four colours. Rejuvenation grout only requires 1mm depth to properly adhere to existing grout or surface.
As easy as it seems, simply grout over the existing grout. Rejuvenation grout will fill any holes or gaps in the existing grout as well as cover the existing grout. You can even use it to change your grout colour.
Naturally, before you use the product you will use best endeavours to clean any loose detritus from the area to be grouted and make sure it is completely dry. Leave for about 24 hours before having your next shower.
Rejuvenation grout is for smooth surfaced tiles only. Indoor / outdoor, floor or wall. - PJA
For edges, often times it is silicone that is placed between where the floor meets the wall tiles and not just more grout. In order to remove the old silicone you need a silicone scrapper tool. After removing and cleaning the area you can then apply new silicone to the area and have a nice new looking bathroom seal. - redracer01
If you wish to repair and not replace all of the grout I suggest using Dunlop 800g Ready-To-Go Coloured Grout - White. It is pre-mixed grout and can be used immediately. I recommend using this tool QEP Carbide Grout Saw to remove the old grout. If you’ve got some old grout lying around, if it has been opened and is more than one-year-old I don't recommend using it. - EricL