Japanese by Example
Learning through examples in manga

Taking a hardhearted stance with 心を鬼にする

かわいそうだと(おも)いながら、(きび)しい態度(たいど)をとる。

To take a harsh attitude (with someone) while feeling sorry (for them).

Goo Dictionary

The expression (こころ)(おに)にする means to take a stern attitude with someone for their sake, even though you feel sorry for them.

Note: This expression is only used when being strict with someone else, not when being strict with oneself.

Examples

好きな子がめがねを忘れた » Volume 2 » Page 119