you can't just say "i know I prob should have folded" then move on. you have a crazy difficult hand to play and it's just a guessing game. you pretty much have to go with it on the turn but tbh most hands that are gonna continue either beat you or have a lot of equity. it's really just guessing.
one option is you prob can check/call and fold a lot of rivers. sometimes people bet too small or are scared. then if the river is a straight or flush card and he still bets you can save a little bit. i dunno.
your biggest mistake was trying to raise this bad hand on a table you described as loose. the turn decision is pretty close. btw i wouldn't have cbet the flop either. this is a mess all around