Here's a fun calculator for it: https://www.surplace.fr/ffgc/
Notice that a very common gear combo, 44/16 only gives 4 skid patches, so if you're after longer lasting tyres avoid this setup.
He goes into the nerdy depths of gear make-up, metallurgy, meshing, machining and mistakes as he manufactured metal gears on a mini-lathe.
That's also what I was taught as a best practice, but it's not always possible.
Gears: If it's not solving all your problems, you simply aren't using enough of it.
Defn: a & b are coprime/ relatively prime iff GCD(a,b) = 1