There is a custom brought in Shulchan Aruch for people to kiss the mezuzah every time they pass by one. The Rama mentions that people have a minhag to touch the mezuzah when they leave the house or come into it, and that some people even say the passuk (paraphrased from Tehilim 121) Hashem yishmor tzeisi u'voiee, that Hashem should protect their going and coming.
The purpose of the mezuzah is for a person to always remember Hashem, which is facilitated by seeing the mezuzah.
The Rebbe mentions that there is a Jewish custom to kiss the mezuzah before a person goes to sleep, upon waking up in the morning, and many times throughout the day. Parents should accustom their children to do so.
The Rambam writes that every time people go in and out of the house, they will see the Unity of Hashem and reawaken their love for Hashem, consequently waking up from their spiritual slumber and forgetting about all the non-sense of this world. This realization will remind them that the only thing that is the real Truth (because it is the only thing that lasts forever) is Hashem.
Putting one’s hand on the Mezuzah every time one passes by and thinking about this is a constant reminder of the truly important things in life.