Whether you're repainting the entire wall or fixing scuffed paint with the same color, simply remove a tiny piece of your wall and bring it to the paint supplier to color match.
Per @caranewhart on TikTok, remove an outlet cover and cut off a tiny piece of drywall — just the top layer with paint — so the outlet cover will later conceal the missing piece.
If you're hesitant to remove a piece of your drywall, try checking for outlet covers that may have been painted over, and bring this cover to the paint supplier for color matching.