From history it seems that you might be having tap worm infestation.
go for stool test
for ova and cyst
of parasite and confirm tap worm infestation.
consult your doctor and go for anti-helminth treatment accordingly.
Keep your hand fingers nail clean and well cut.
Make a habit of cleaning your both hands with soap while coming from out side or handling something.
Ok and take care.