The secret is to use "macro mode", a feature nearly all cameras have nowadays. It's intended to take closeup pictures of things only a few inches away from the lens, but since that's the apparent distance of what you see through a scope, it works for that as well.
Step 1: The Standard Icon Representing Macro Mode Usually Involves a Flower and Sometimes the Letters "MF" (for "macro Focus").
Step 2: For Quick-and-dirty Work, You Can Use Nothing More Than Your Hand to Hold the Camera Lens Up to the Eyepiece
Make a ring with your fingers keeping the lens and the eyepiece about a half-inch apart.
Step 3: Center and Focus
Then look at the viewfinder LCD of your camera and you'll see a round blob of light that moves in the opposite direction from what you'd expect.
You want to keep things steady and try to center this blob. You'll probably find that you need to adjust the distance between the lens and the eyepiece a bit before your camera will be able to focus properly.
Step 4: Then Take a Picture
This creature was crawling around on a leaf in my front yard. Pretty frightening, especially if you are an oak tree.
You can, of course, crop the image to remove the black circle (which is called "vignetting", and is a side effect of not spending $100 on an actual lens adapter.)
Step 5: Use a Tripod
After awhile, you'll find that keeping everything centered and steady is a fair bit of work, so if you want to take more than a few images, try using a tripod to maintain the lens-to-eyepiece distance for you.
Step 6: Make Some Videos
Since my digital camera will also take short videos, I was able to get moving pictures of the nasty oak-eating insect crawling around on a small screwdriver ...
Step 7: Telescopes and More
All of this will also work for taking pictures through a telescope, although you'll probably find that a tripod is more necessary for stability, and that many cameras will have trouble with dark subjects (like the night sky). It works well for terrestrial pictures in daylight.
Thanks to nospleen (Erich Brandeau) for taking pictures of me taking pictures.
(Instructables user davidmerrill used this technique to illustrate his wonderful explanation of how to hand solder SMT chips (https://www.instructables.com/ex/i/0E9564B43CE71029AC23001143E7E506/?ALLSTEPS). But the technique is so useful and little-known that I thought it deserved its own Instructable.)