Tutorial link in comment] So i made this video on how to do all mechanical mates in solidworks. this video is specially for beginners . Things you will learn after watching .
How to Create Gear 3D Model SolidWorks Excercises for Beginners
Creating Spur and Helical Gears in SOLIDWORKS | LearnSOLIDWORKS.com
SOLIDWORKS Rack and Pinion Mate Tutorial | GoEngineer
Introduction to SOLIDWORKS Mates: Standard, Advanced, & Mechanical | GoEngineer