Not to put too fine a point on it but being a rude loser is just a sign of immaturity. It is basically pitching a fit because you didn't get your way.
How to stop being a sore loser?

Play a lot of OTB chess. Manners will improve markedly if there's a chance that your opponent will suggest that the matter be taken outside for resolution.

In order to stop being a sore loser, just be numb. Train like Saitama, and once hair loss and regret sets in, destroy all your opponents with the power of love, friendship, and plot armor.
Seriously though, online chess doesn't really matter. Imagine it to be a video game. You just respawn and get more lives. Who cares? Online chess is carefree and happy. Enjoy it!

The main thing you've got to understand more than anything else is how counterproductive being a sore loser is. It might give you temporary relief from a particularly painful loss but it will do more damage in the long run. Throwing a tantrum will not only give you a bad reputation in the chess community but will also lead to more loses and frustration. Keeping your cool and learning from your mistakes instead of having a meltdown will make you not only a better chess player but a better more successful person in general.

Carlsen said that being a sore loser was one of his weaknesses, but he’d rather not work on improving that particular skill. The antidote is just to stop losing. That was Fischer’s solution. He didn’t lose a serious game fro 1972-1992!
Being a good loser is a skill and comes with experience. It's also easier to lose to a friend or a respectable player than someone who is insulting you, cheating, or otherwise being a bad sport.