Chess is a game of give and take. If you take the initiative, sometimes you have to give a pawn or some other positional concession. If you take material, often you have to give your opponent counterplay. If you take a square with a pawn, you give your opponent the square next to the pawn. I think you get the idea.
So the question is whether what you take is more valuable than what you give to get it. When you find yourself on the defense, if you haven’t blundered, then your opponent has given you something. The key is for you to stay active and find out what that something is.
In the video here, Paul Keres gives his opponent an attack. In return, his opponent gives him a target (the d4 pawn) and the exchange. That’s enough for Keres.
Enjoy this game with my commentary.