First, paint the lid of the can. Before you use the lid, make sure that every spot is covered and no paint has peeled or chipped off as it will ruin the film. You'll also want to check periodically to make sure the paint is still intact. On the inside, you can either paint with a dull black color or line the inside with black paper so that there's no reflection given off.
To make the pinhole, use the side that is not removable. When using a pinhole camera it's much easier to attach the film to the removable end of the camera. For a camera with the film that ends up being three to six inches from the pinhole, a good size for the hole is about 1/75 inches. The hole can either be made into the can itself, or you could make a bigger hole in the can. If you decide to make a bigger hole in the can (as a sewing needle may be a bit hard to poke through a coffee can) you'll want to make the hole about ¼ inch. You can actually use a piece of thick black paper to poke the 1/75 inch hole into and then fasten that paper over the larger hole in the can.
The needle should be poked through halfway, and it's best to rotate the needle as you push it through to make the hole smoother. You can also use different needle sizes and experiment with the photos to see what size you think works best. After you've got that complete, look through the camera at a poster or newspaper to make sure that the image is clearly visible. If not, you may have to sand the edges with a piece of sandpaper.