I think, you have done everything correctly. After the turn came 4 and the opponent raises - you can fold your 2 pair. In this situation, of course, you can pull up the river - to try to collect a full house, but it will cost you dearly.
In your case, to take the pot - you need to make a raise or re-raise after the flop.
We would have to see the action of this hand pre flop.
The pair of eight and the AK came limp?
The button was on the player with the flag of sweden, AK on BB.
His hand was almost the worst possible, in an environment where two of your pair were already losing on the turn to the 88 villain and on the river you would lose to everyone.
In short, it would be a pre fold .... if you have entered limp it would be
Hi friend, I think you should have seen the turn because on the flop you had to win and if the limits of the bets were low you should have bet with that double pair, but then I think that when folding before Turn was a luck to you since if your opponent was a kamicase you would have risked losing more, it is my opinion.