Give (someone) what’s coming to him or her

To give someone what they deserve.

I gave my neighbor what’s coming to her when I complained to the police about her dog.