Motors are elsewhere, running on electricity, and sometimes the problem is to create linear motion from them because they simply spin. Here we are going to discuss about some of the most used methods around.
You could attach a threaded rod directly to the motor, and a nut to the moving part. When you give a signal to the motor, the nut will move. This is easy, with parts that are available in multiple hardware stores. However, these don't work very well in comparison with specially designed rods and nuts, mostly known as lead screws and ACME rod, so if the goal is increased accuracy, it's necessary to invest more.
The other usual method is based on belts. With the advent of 3D printers, these are easy to find on Internet —for instance with the keywords GT2 motion belt— and they are not expensive. The resolution is nice and it allows an interesting set of possibilities for multiple projects.
Between threaded rods and belt based solutions, some prefer the belt because it's more efficient for long distances. With severe weights, the belt needs to be strong. The torque in the threaded rod would be more considerable, so the motor needs to have better specifications and this usually means a higher price point.
Ball screws are in the top of the list, both price and characteristics. Don't forget gears as well, with direct contact to the moving part.