Hollow out the pumpkin and cut out the mouth as show. (Once you finish painting the pumpkin)
Glue black circles on Styrofoam balls
What i usually do is push a toothpick into the pumpkin top for the eyes, remove and reinsert and remove again :) so you have your holes ready, now all you need to do is insert the toothpicks in the styrofoam balls (eyes) and push down into the pre-made pumpkin holes :)
Getting your pumpkin ready for painting:
Give your pumpkin a wash to remove any dirt or dust. The easiest is to use a damp cloth or wet-wipe, or with a hosepipe on the lawn. Don't scrub with a hard brush as you risk damaging the skin. Wipe with a dry cloth or paper towel, or leave to air dry
Painting on a layer of sealer or varnish is optional, though it will help the paint to stick. (It's also said to slow down the evaporation of moisture from the pumpkin helping it to last longer, but really, painted pumpkins are temporary artworks.) Any type of general purpose sealer or acrylic medium ought to be okay, but if in doubt do a small test on the bottom of your pumpkin first.
Acrylic paints (whether craft or artist's acrylics) work best, but if you've only poster paints or kids' paints do a test to see how they stick before getting the family involved. You likely will find the latter come off if it rains, if the pumpkin is handled too much or with wet hands but is otherwise okay.
When you've finished, consider adding another layer of sealer or varnish to protect your painted pumpkin. A spray-on varnish makes this final stage easy, but remember you don't want to inhale any of it so read the instructions on the can and do it outside if possible.
To avoid your cookies to have a small taste of pumpkin, i suggest you wrap them individually with plastic wrap :)