I drew a pulley and a sliding rail that matches it. How do I put the two together correctly and closely?

I did it by moving little by little. I don’t know if there is any shortcut.

Use translate tool.

Since you have a circular shape “hole” it should be easy.

Try using temporary sketches to help the Translation tool. (Reference the electric motor tutorial where they use sketches to move the hex bolts into place.) For example, you could sketch a circle mid plane of your pulley, then another circle sketched mid plane on your rail where you want the pulley to go. Then Translate from center to center of those two sketched circles.

thank you guys! I really feel that this is a community that helps each other。