He could have scratched it, or bumped it on something, . Were you able to see anything in it like a simple hair? If you have Normal saline at home (for your contact lenses) if you can hold him still, try flushing it and see if it helps, if it is just dirt it will help. If not, the vet can use his equipment to look inside and also do a dye test to check for damage, then give you ointments that will help.
if you want you can take the saline solution people use to clean their contacts with and use it to flush out his eye. clean up any goop that may be around it, if he is still obviously bothered by it a vet visit is in order. you dont want to mess around with eyes cause tiny little problems can manifest into huge problems really fast. there is nothing you can get over the counter that you could put in it. and you need ot check for scratches or ulcers before certain eye meds can be used because things with cortisone in them can make ulcers worse instead of better.