If you can see the piece and it is large enough to be pinched out with your fingers (eg half or more of a contact lens), you could try carefully doing that.
If it is a tiny fragment (eg 1-2mm diameter), you could try washing it out with a saline rinse of the eye.
You need to go to an accident and emergency department or eye clinic if:
- It doesn't fit in any of the above categories,
- It doesn't come out with the above methods or
- Your eye feels persistently irritated
A doctor there will carefully look for the fragment and if there is one present, remove it with a special pair of fine forceps.
Do not try too hard, and do not try to remove it if you cannot clearly see the contact lens/fragment. Trying to remove a lens that you cannot clearly see risks scratching your eye (cornea +/- conjunctiva).