If your pet's eyes are red, cloudy, have a discharge, or if your pet is holding one or both eyes closed/squinting, see your veterinarian.
If a foreign object is in the eye, gently rinse it with water or saline solution. Foreign objects cause corneal ulcers, so you should see your vet whether or not the object rinses free.
Cover both eyes if there is an object that does not come free with rinsing - this will stop your pet from looking from side to side with the normal eye and irritating the eye with the foreign object.
If your dog's eye comes out of the socket, keep the eye wet using sterile eye wash while you head to the vet's office. If you have a cat whose eye has come out of the socket, there is usually head trauma associated with this event - do not delay seeing your veterinarian.