The best way is to spay or neuter your cat. There is no other option for a cat in heat.
This technique works definitely for a couple of hours... It relieves them of the urge to mate. Try it.. Do not press too hard as this will hurt the cat. Do not try this with a cat that is not in heat. .