I know there are sociopaths in the world, and there is no way to deal with them in a way you'll feel good about, but most of the people who treat you rudely in your everyday life are not sociopaths. They may be simply having a bad day or have had difficult circumstances.
Even if you never find out why they deal with you the way they do, you can easily alter the way you think about them so their rudeness doesn't ruin your mood.
Abraham Lincoln did it when dealing with Edwin Stanton, and you can do it too. Find out how: Disarming Hostility.