Rubber gaskets are generally used to seal threaded connections and fittings. Lubricants are used to fill in the "gaps," making the mating surface more uniform and consistent. Not all lubricants are considered safe for use on rubber because they can degrade the rubber, making it crack or fall apart over time.
Silicon-based lubricants won't degrade the gasket over time. Silicon is resistant to heat, detergents, fuels and other corrosive agents.
Polytetrafluoroethylene -- PTFE -- is commonly known as Teflon and is used as a gasket lubricant and anti-seize lubricant but is not intended for use in food processing because it is toxic.
Lithium grease is used for pneumatic applications. Lithium is also suitable for high-pressure and high-temperature use.
Also known as petroleum jelly or vaseline, it is not generally recommended for use with rubber gaskets, although it is commonly used in hydraulic applications because the detergents in hydraulic fluid won't cause it to breakdown.
Using spray lubricant is not advised because the propellant may degrade the rubber gasket.
Not all lubricants are safe to use with food products or sterile environments. Review the Material Safety Data Sheet -- MSDS -- before use.