Catnip contains a substance called nepetalactone, which has a hallucinogenic effect on cats. It stimulates the cat's central nervous system, making them excited and happy, which is why cats love catnip. When cats smell catnip or eat it, they will exhibit different behaviors than usual, such as rolling on the ground in a trance or rubbing their heads. 
Precautions for using catnip:
1. Dosage. Do not use too much catnip at once. Use only a small amount, about the size of your thumbnail.
2. Frequency. Do not allow your cat to be exposed to catnip for extended periods. Using it too frequently will reduce its effectiveness for your cat.
3. Contraindications. Catnip should not be used on pregnant cats as it can cause miscarriage. It should not be used on kittens as it can irritate their respiratory system.