The easiest technique (though it requires an equatorial mount) is called
Piggyback photography. The camera, with its associated lens, is attached
to a bracket on the back of the scope, and the shutter is opened for a
desired period while the telescope is tracking the movement of the object
as the Earth turns. Obviously, this requires that the telescope be driven
by a motor to follow the stars. It is the only way to get extremely widefield
photography of large parts of the sky (such as the center of the Milky
Way, or a full constellation).
Many objects are too small to be seen this way, though, so there is another
basic technique called Afocal photography—essentially, shooting
through the eyepiece. Using an inexpensive bracket to hold the camera,
the camera is moved to a position where it sees the same field of view
as the eyepiece. This is called Afocal because the position of the camera
behind the eyepiece does not determine the focus of the image, only the
size of the field of view seen. This type of photography is great for
catching pictures of the Sun, Moon, and planets.
Lastly, there is the technique of longer-duration pictures of most objects
in the sky, such as galaxies and nebulae, called Prime Focus photography.
The camera is attached directly to an adapter (without the camera’s
lens) which is attached or inserted into the telescope. In essence, the
telescope has been turned into a very long focal length telephoto lens.
This is the preferred technique for shooting star clusters, nebulae, comets,
and other galaxies.