One of the most common complaints I've heard from IT workers over my years of working in the industry is "users are idiots" or some variant thereof. It's an understandable but ultimately self-defeating attitude. Users are your customers, they're the reason you have a job - treat them badly enough and you won't have them or a job for long.
This is true whether they are literally customers (people who buy a product you make) or metaphorical customers (the people within your company who use the product you develop). This attitude is the primary reason IT workers have a reputation for arrogance in the business world.
This is not a touchy-feely "always put the customer first" post. Some users are truly stupid. Many more, while not being inherently stupid, are capable of behaving in what seem to be incredibly stupid ways. A couple of my favourite examples from previous jobs:
One of the many times I was "lucky" enough to be working in the public service, I was working on the development of a global intranet for a division of the federal government's foreign trade department. This was an intranet to serve over 100 overseas offices and one of the top public servants from Canberra came in to see how it was going. This guy looked like a stereotype of a British major-general with a huge walrus moustache. He gave off a vibe that made it obvious he considered us lucky to be worthy of his attention.
I started the demo I had been giving users from various offices (which had been going quite well with other users). I opened the home page and started to explain how clicking on the various links would let you complete certain tasks and invited him to try it for himself. He did this by picking the mouse up from the desk and trying to use it like a TV remote - pointing it at the part of the screen he wanted to use, clicking madly, then berating me because "it wasn't working". I resisted the urge to ask "are you from the past?"
In another case I was running a training session with a group and one user in particular was having trouble so I was taking him through the process again:
ME: Right click on that link.
HIM: I am!
ME: No, you need to right click. With the right mouse button.
HIM: I know how to use a mouse, I'm clicking it right and it isn't working.
ME: Sorry, I didn't mean right as in "correct". There are two buttons on the mouse; one is on the left side, on is on the right. When I say "right click" I mean click the button on the right hand side. I'm not passing judgement on whether or not you are correct.
HIM: You don't have to talk to me as if I'm stupid.
ME: You reckon?
At this point I absolutely did not trust myself to keep speaking to this person and so called for a break. I bring these stories up firstly to provide a bit of a laugh (hopefully) and second, to illustrate that, yes, we do see some truly stupid user behaviour from time to time. So this is the recurring conundrum faced by IT workers: users behave like idiots but it's a bad idea to treat them like they're stupid because our jobs depend on them.
The first coping strategy I would suggest is the one I described above: take a break. It often doesn't occur to people to stop a conversation that's going nowhere. Do it in the appropriate way, of course. Saying: "Let's get back to this later. I've made a note of your issues and I'll look into them more then get back to you," works way better than "Shut up! You're stupid! I'm not talking to you any more."
Likewise, email doesn't have to be answered instantly (despite what some people seem to think). If you get what you think is a stupid email, take some time to think about a reply. Get a second opinion if you can. Just don't fire off a quick response that makes it clear you think the user is stupid.
It's also important to be able to determine when the "stupid user" behaviour isn't an IT issue at all, even though it's being directed at IT. If a user's system isn't working because of the crap they've installed on their machine ("Download a free animated screen saver? That sounds like a great idea - what could possibly go wrong?") that isn't an IT issue, it's a HR issue because they're misusing their PC. If a user lack basic computer literacy that isn't an IT issue, it's a training issue. If a user keeps bugging individual developers and eating up their time rather than following established channels, that's a management issue.
One of the most important things to learn when dealing with stupid user behaviour is recognising when dealing with a stupid user isn't part of your skill set. Most developers aren't hired for their people skills - it's great if you have good people skills but it's important to be honest (both with yourself and with others) when you don't. That's why Business Analysts, Team Leaders and Project Managers exist. If you're in one of these roles and you have lousy people skills then something is seriously wrong.
At the risk of ending with a platitude, if you aren't part of the solution then you're part of the problem. It's easy to bitch and moan about how stupid users are (all too often it's like shooting fish in a barrel) but that does nothing to make the situation better. In a world where IT work is increasingly commoditised and a wider range of jobs are in danger of being outsourced, people skills become increasingly valuable. So learning how to deal with stupid users can save your job as well as your sanity. I'll borrow from another well-known platitude to close on a positive note:
There are no stupid users - just stupid situations.*
(*caveat: there really are some stupid users)