As @davebYYPCU said, you have an unusual component structure, with components named "Body1" and "Body19", and two copies of the rack geometry. You might be better off starting over. However, I think I was able to get what you were trying to achieve without that. There were 4 big steps:
1. step 1 is getting rid of the duplicate rack geometry. I would have kept the fixed geometry in Body19, but it was off-center. So, instead, I removed that:
2. there was a slider joint that I think was incorrect. I deleted that, and instead created a new one between "Body1" and "Body19", so that the component with the cylinder moves correctly up and down:
3. next, I created a rigid joint between the Rack component and the cylinder. This required the use of joint origins in each component, to place the rack at the right place: centered, and outside of the cylinder:
4. Finally, create the revolute joint between the small gear and its axis. Before that, I had to remove an incorrect revolute joint. And then: create a Motion Link between the revolute and the slider:
Hope this gives you enough to go on. Joints are not that difficult. You just have to mimic the way they work in the real world. Model is attached
Jeff Strater
Engineering Director