From a medical perspective, the recommended thing to do is to do the following:

i) blink ... a lot ...
ii) if that fails to get the object out, wash the eye with lots of water
iii) if that fails, contact a doctor

It may actually be dangerous to do what jt suggests if the object is hard, sharp and embedded in the conjunctiva under the eyelid, where holding the eyelid against the eye and moving the eyeball vigorously against it would only cause more scratching of the cornea.

The above advice is what you should do if you get some grit in your eye.

If you are slightly medically inclined and have the appropriate materials, you can look under each eyelid with good lighting. Evert the upper eyelid and look carefully right up to the deepest part of each conjuctiva. If you have some local anaesthetic eyedrops (which I seriously hope most people don't have sitting at home), you can attempt to remove the foreign object with a small sterile needle with the patient lying very still after putting a couple of drops in.

If you are not medically trained, please DO NOT try anything harsher than blinking or washing with water and blinking. DO NOT rub the eye vigorously (it may be impossible to avoid rubbing at all with that irritation in the eye). Making your eye tear by holding the upper eyelid over the lower eyelid is not recommended medical advice. If there is a foreign body under either eyelid, the eye should water naturally anyway.

And let's not even mention what to do in penetrating eye injuries here ...