Fundamental rule:
Listen to your eyes. Whether they are sore, tearing, itchy or tired, they are sending you a message. Listen to them. If your eyes hurt when you have been working at the computer for too long, stop and take a break. Be receptive to your eyes.
Palming :
A simple technique called palming can refresh your eyes when they are feeling tired( Remember the first rule! ).
The term 'palming' was coined by William Bates, the author of 2 books on vision improvement (The Bates Method for Better Eyesight Without Glasses/With Eye Chart) and (The Cure of Imperfect Sight by Treatment Without Glasses).
You just close your eyes and cover them with your palms, resting them on your cheek bones. Make sure you do not put pressure on your eyeballs. Relax and think of pleasant images. A variation is to imagine the 'blackest' black that you can. But the important thing is to keep your mind relaxed. There are more eye exercises available on the Vision Improvement Site.
Computer work:
Nowadays, people spend a lot of time in front of the computer screen. Thus it is even more crucial to give your eyes adequate rest. Here are some things you can do:
If possible, do computer work without wearing your glasses. I know this is difficult for most people but this is enormously beneficial. I can only see the screen about 8-10 inches away, so I move the monitor nearer and shift my chair forward. Now my eyes don't feel as tried as before.
Look up across the room or out of the window every few minutes. Take a few deep breathes before continuing your work.
Stop work after every 40 minutes or so. Get up from your seat and take a walk around the place. Palm for a few minutes before going back to face the computer screen again.
Whenever possible, make use of your distant vision. Extended periods of time spent at the computer can really spoil one's eyesight, as you may have noticed. Seek out opportunities to see things that are far away.
Reading:
When you are reading, do try to read without wearing your prescription glasses. Most people will find they can do so at a comfortable distance. Put the material you are reading far away just so that the letters can be seen clearly. Gradually, the distance at which you can read will increase.