Every time you are considering a trade, you should consider does a trade benefits you or not. To know does it benefits you, you need to get better.
For instance here, after you take the knight, the opponent would have double isolated pawns in h file and an isolated pawn in f file. His pawn structure would be compromised. Another benefit is that he will not be able to castle kingside as it wouldn't be wise with that pawn structure. On the other hand you are parting with the bishop pair so you should try to weigh in pros and cons of every trade.
Exchanging pieces?
Thank you nklristic - that's very helpful! That was my problem, that I couldn't see a clear benefit to it. It just seemed like an "even" trade. But the compromised pawn structure is a benefit I hadn't thought about.
Yeah, every trade, even the one that looks even is sometimes (not always) more beneficial to one side or the other.
If you have the time, here is one great video on exchanging pieces:
It is rather long but extremely useful.
I've come across situations like this a few times now, where the game analysis tells me I should go ahead and take a piece, even though my attacking piece is just going to get immediately re-taken. Can someone explain why a trade like this is deemed the best move in this situation? I'm wondering if it's because it's assuming I can do something specific with that new position, but I'm too inexperienced to see what it is. And not knowing what the chess engine is thinking, it seems weird to me to give up a bishop in an even trade. Thanks!