Filling a hole properly
Filler shrinks. Apply it proud, let it cure fully, then sand it back — in that order.

The job is two applications, not one
The instinct is to fill flush and walk away. It never works. Every ready-mixed filler and most powder fillers shrink as they dry, pulling the surface down below the surrounding wall. Sand that and you have a shallow dish. Paint over the dish and you have a visible hollow forever, especially under a raking light.
The correct method is to slightly overfill — load the filler so it sits fractionally proud of the surface — let it cure completely, then sand back to flat. On anything deeper than a shallow screw hole, do this in two applications: a first fill, full cure, a light sand to knock back the worst, then a second application proud again, full cure, final sand. Trying to do it in one thick pass invites cracking as the outside skin cures faster than the interior.

For small holes — nail pops, screw heads, minor dings — a ready-mixed filler works well and sands easily. For larger repairs, a powder filler mixed stiff gives more control and less shrinkage per pass. Mix it to a thick, smooth paste: too wet and it slumps out of the hole; too dry and it tears when you smooth it.
The tool matters more than people expect. A flexible filling knife — not a rigid stripping knife — lets you feather the edges of the filler into the surrounding surface so there is no hard ridge to catch the light. Draw the blade across the hole at a shallow angle, pressing gently at the edges. Leave it proud. Walk away.

"Fully cured" is not "surface-dry." Press a fingernail into the centre of the repair. If it dents, it is not ready. Rushing this step is the reason most patches are visible under paint.
Draw the blade across the hole at a shallow angle, pressing gently at the edges.
Sand with a block — never with your fingers alone — working through the grits until the repair is truly flush. Run your hand across it in several directions; fingers catch irregularities that eyes miss. Dust off completely before priming. A small, freshly repaired patch is thirsty and will drink the first coat of paint unevenly if it is not spot-primed first.

What preparation actually is — the washing, the filling, the sanding — is the part that decides how the paint looks. The filling is just one step in that sequence, but it has to be done in the right order.