There are basically four ways to connect your camera to a telescope. The most obvious is to remove your camera lens and use the telescope as a telephoto lens, usually called Prime Focus or Direct Objective photography. The other three are a form of Projection lens photography.
Diagram from Sam Brown “All About Telescopes”
Advantages and Disadvantages of each:
Type 1: Best for DSOs, galaxies, nebula, etc. Shortest exposure times, still many minutes on faint objects, but not hours. Might not reach focus with common SLR cameras, reflectors will require too much ‘in’ focus, refractors might need extension tubes.
Type 2: Easiest for cell phone users, most obvious for that quick snap of the moon. Keeping all these parts square might be a problem, light leaks at the junction a problem for any long exposure. Basically too many moving parts to get a quality photo.
Type 3: Generally not used anymore, too many disadvantages, eyepieces are not designed for this, the resultant tube length can be quit long and unwieldy.
Type 4: Best for planetary photos, need great magnification to enlarge those tiny spheres. Varying the negative lens, Barlow, position by only an inch or two will change the enlargement from 1x to infinity.