HELP! Why exchanging rooks is good for black in this position and a move later it is good for white?

lichess.org/nz0ooAQq/black#47

I want to ask that why exchanging rooks is good for black in this position.

And why after 24. ... Bd8 exchanging rooks is good for white.

Thanks in advance to anyone helping me.

It does not really matter: it was winning for black anyhow.
24...Bd8 was a poor move: the bishop was better on e7 than on d8.
With the bishop on e7, black can swing the queen over d8 to h8 after a trade of rooks.

#2 I played 24...Bd8 because I wanted to maneuver my knight on c6 to f5 via the e7-square.
Please tell me why exchanging rooks became good for white after Bd8.
Also tell why you think the position is winning for black.

So we're not gonna get thanked afterwards?

#3
"I played 24...Bd8 because I wanted to maneuver my knight on c6 to f5 via the e7-square." -- Fair enough, but that was not the most efficient plan. The most characterizing trait of the position was the open h-file. black can control it by exchanging twice on h1 and then Qd8-h8+
"Please tell me why exchanging rooks became good for white after Bd8." --- because white can get rid of the rook pile-up on the open h-file without fearing Qd8-h8+
"Also tell why you think the position is winning for black." -- weak pawn g5, bad bishop g3, rooks on open h-file
"Again, thanks in advance." -- You are wellcome.

#4 All my thanks are in advance, :)
Now, I want to ask that is shall I study endgames or middlegames first?
@tpr , @MrPushwood , @ anyone who wants to suggest.
Once again, thanks in advance. ;)

#6
Endgames first: start with the 5 basic checkmates, then KP vs. K, KQ vs. KP, KQ vs. KR etc.
A good book is "Chess Fundamentals" by Capablanca

The exchange of both rooks is good, because black can afterwards sacrifice a piece on b4, getting three unstoppable pawns for it. For example ...

lichess.org/1q6uEiKN#58

... and white can not stop the black pawns.

If black starts with the piece sacrifice then white can exchange one rook on h7 and keep one rook. That rook controls the first rank and can create counterthreats against the black king together with the queen. For example ...

lichess.org/KGQ49qNc#57

... where white suddenly has a winning attack, or ...

lichess.org/0HFaPSLL#69

... where both have dangerous threats but it will be a perpetual soon.

@tpr @selfbrain @MrPushwood I know basic endgame techniques. I am asking about the general level of play during the endgame or middlegame. All suggestions are welcome.

EDIT: "Now, I want to ask that is shall I study endgames or middlegames first?"
Sorry about that "is" in the last post(#6). I typed it by mistake.

Tarrasch taught endgames first, so that you'd know what to do in the middlegame. He taught the middlegame next so that you'd know what to do in the opening. He taught openings last, but did opening principles before specific openings. This is arguably the "best" way to learn the game. However, everyone wants to learn it in the reverse order to how Tarrasch taught it because they want to start playing immediately.

Since you've done basic endgames, then assuming you know opening principles, do middlegame next.

Reconnecting