Instead of taping it off, you want to cut in with the brush. There are a lot of videos on youtube showing how to do it of varying quality but this one is pretty good:
https://www.youtube.com/watch?v=-QpdW-l0FRg. This takes some practice but works great once you get the hang of it. You can still tape off but mostly as an extra precaution. If you do tape, you want to pull the tape off while the paint is still wet or at least score the edge with a razor so the paint doesn't peel off with the tape.
I can't see from the picture if there's a lot of grout between the wall and the top row of tile. If you already tried to paint and go paint on that, you could clean it off and try again. Caulking over the extra paint would work too but now you don't have grout there. Best option is to paint before the grout is applied like CX said.