Combat
Not every capture is worth playing. Take a piece nobody defends. Leave a piece that is defended, unless what you take is worth more than what you will lose.
Count the trade before you make it. A rook that takes a loose queen is a gain. A queen that takes a defended pawn is a loss.
Take the loose queen
The queen on b7 sits on the rook's file and nothing defends it. The rook takes it.
Do not grab the protected pawn
The king on e6 defends the pawn. Qxe5+ is legal, and it loses the queen on the next move.