Wet surface of eye. As a contact lens wearer having had this happen, it is frustrating. Remain calm. Find some wetting solution or viscous artificial tear solution and rins.E the eye. Usually contacts get stuck when the eye is very dry, so this works. For rgp lenses, sometimes the tiny suction cup can be used. Try irrigation first.
Flush it out. For soft contact lenses, use artificial tears or a wetting solution and try to flush it out. Put a stopper in the sink so you know when it has come out. For rigid gas permeable lenses, you may want to see an eye doctor as you don't want to risk losing the lens or damaging it or your eye.
Don't panic! If it is a soft lens it may have dried out and adhered to the cornea. Simply add rewetting drops or soaking solution in a pinch over a couple of hours and it should come out. Don't force it, you may cause a painful abrasion - be patient. If it still doesn't come out, see your eye doctor.