If you happen to get grease in your eye when cooking you should immediately wash the grease out with some water.
If you cannot get the eye to stop hurting from the grease or cannot get all the grease out you should see a doctor.
After getting grease in my eye a few times and having painful eyes as a result I now wear goggles when I'm cooking anything with grease that may splash into my eyes and I've never had the problem of getting grease in my eyes after that.
You can also wash the area around the eye with some baby shampoo but never get the shampoo in the eye.