2nd hand ...
If I'm reading this right, the pre-flop here is very fishy, sorry. You limp-called 4x UtG?? Ooof. Never say never but UtG is almost NEVER a limp. Not 25bb deep at a 7 seat table. Basically from this seat we want to open our strongest
hands and fold everything else. Q9s is not strong enough to play here and we certainly shouldn't be calling 4x with it after showing Villain a capped range (capped range means that we are unlikely to have strong cards due to our limp - strong cards would open bet, not limp). Especially as a player of limited experience in an exploitative environment, just fold that meh hand. Want to play Q9s? Open it from the BT or maybe defend with good pot
odds from the blinds (although that's tougher to do for an inexperienced player so okay to fold too).
Then you donk the river for 3/4 of your stack. If you're betting large there, just shove. You're clicking the pot button with no awareness of your own stack. That extra 21k behind does nothing for you. He's not going to call. He's either folding or putting you all-in and if he puts you all-in you're not folding so just stick it in yourself ... or size down, although I think at this point jam is good. The flush busts and there is a decent amount of non-boat Jx and Tx that could pay you off while a jam kills any of his bluffs.
Judging by both hands it looks like you might be a chronic limper. If so, stop it. We want to be tight and aggressive, not wide, limpy limp-cally and passive.
Your pre-flop on the first hand, we overlimped 22 from CO (overlimp means there was a limp before us) which is actually an okay play, but then when it comes back around we fold to a smaller bet than we called in the 2nd hand even when a caller between gave us juicy
pot odds and we had a chance to close the action. We had a relatively cheap price and could have won a monster but we let it go.
Comparing this to the 2nd hand, we open limped (no limper before us) from the worst seat at the table with a hand very much out of range, then called a large open with poor pot odds heads-up. We had an expensive call out of position while holding a hand that is not as good as it looks after showing an aggressive Villain a capped range.
Going by many of your posts (including this one) you seem to be fixated on avoiding coolers. There's not much that we can do to avoid coolers and suckouts. He had a set of J and we turned a straight. If not for the river, we gave him a cooler too. It works both ways. Don't worry about the coolers. Work on your pre-flop. There is tons of info out there about pre-flop, position ranges and sizings. Once you get that down (and it will take a bit of time) the post-flop spots will make far more sense. I was the same way. "How do I get out of this turn spot?" I would ask. And people would tell me, "Don't get into it in the first place by playing the pre-flop so badly. Go learn pre-flop." Trust me. I've been there and have the scars. : )