There are truly few instances where you can fill and paint a hole in a single step without it being an obvious irregularity on the wall. Anyone who writes that it's possible in a single step is mistaken--it will almost always show. There are tricks if you truly want to be able to do it in one step, and it's certainly possible to fill and paint holes in two or three very easy steps.
Understand that walls are almost never painted pure white in dead flat paint, like ceilings often are. If your walls are painted in a pure white, completely flat finish (most wall paint is not a completely flat finish, unlike ceiling paint), it may be possible to mix a little non-shrink white spackle with white paint, patch your small hole, and have it not show up too obviously. Use a clean finger if you attempt this, not a putty knife. The putty knife will leave a mark on the wall that will necessitate painting over, and there goes your one-step job.
Use caulking if you have pin or nail holes on satin or semi gloss painted walls. The caulking will dry with a slight shine and won't be as noticeable as spackle, which dries flat, even when mixed with a glossy paint. Use white caulking for white walls, and tan or brown caulking for coloured walls. Some speciality paint stores carry caulking in many different colours. Apply the caulking carefully and wipe the surrounding excess off with a clean damp rag. There may be a slight dimple when it dries because caulking shrinks, but it won't be as noticeable as the unfilled hole.
Be really particular if you don't want any dimple to show from shrinking filler. Use a toothpick, matchstick or anything else small enough to plug the small hole just below the surface. Then use your filler of choice, carefully wipe away the excess from around the small repair, and let it dry.
Don't try using toothpaste to fill a hole. It can leave small dark oily-looking spots on the wall and will need to be primed with a blocking primer if you ever want to repaint because the oily appearance will show through on fresh paint. Not only that, the toothpaste will wipe right off if you ever try to clean the walls.
Fill and repaint a small hole in the wall the conventional way. It's easy. Use a putty knife (or perhaps your finger, if it is a textured wall that won't require sanding) to apply non-shrink spackle. If the hole is small, it will only require one coat. Leave a little excess above the wall surface so you can sand it flush once it's dried. Spot prime it with the matching wall paint. Let that dry and apply more wall paint, feathering it out on the surrounding wall. Use the same method of applying paint as the original--brushing paint on a rolled wall is likely to leave permanent, noticeable brush marks.