Not knowing anything about other guy's style, it's impossible to really know what the "right" play was. JTs is a 57% favorite to a random hand, heads-up pre-flop. But the fact that you were calling a 3BB raise makes you probably no better than a coin-flip to a loose player's range, most likely you're way behind, and oh yeah, you're playing out-of-position.
Don't put yourself into situations where you're flipping a coin for all your chips. Coin flips are for roulette players.
I would have folded JTs from the SB facing a 3BB raise preflop with no other callers. If he was a loose player, maybe you call that 50% of the time in the same situation. If you just sat down at that table, you gotta fold.
Given that you called a 3BB raise pf, the donk bet on the flop actually wasn't your worst mistake, but you bet too much into him. If you had led out with a min bet, you potentially accomplish one important goal: Slow him down. 90% of the time, you will face a cbet from him if you check, so oftentimes a well-placed donk can turn an automatic cbet into a simple call, or cut the amount of the cbet he raises you with. Not always, but small bets like that are definitely speed bumps to a loose pf-raiser who misses the flop completely and will just throw out a cbet to try and win the pot right there.
The fact you got raised 15BB was another sure sign you needed to get out fast. It was an easy fold preflop, and a ridiculously easy fold when you got raised 15BB.
The bet on the turn was horrible though, and you called another huge raise. You needed to fold there, not call. Even a re-raise would have been a better idea than flatting.
Here's the thing about poker. It's fucking complicated. So you really want to do things early that keep you from having to make hard decisions later. You're trying to force the other players into making the hard decisions when they are out-of-position and likely to make the mistakes. Every mistake you force another player to make is +EV to you. Every mistake you make is +EV to your opponents.
Here's how you keeps things simple: Muck JTs out-of-position facing a pre-flop raiser with no callers. Wait for a hand when you can be the aggressor. You'll have the stack to do it if you avoid all the mistakes you made on this hand.