There is a number of trapping techniques for ions (Paul trap, Penning trap) and for neutral atoms (magneto-optical trap, optical tweezer, optical lattice).
In the case of trapped ions, their mutual repulsion keeps them tens of micrometers apart, so one can easily resolve the individual ions on a camera image with modest magnification. This is an image of 9 ions taken by the same group that made the artistic image in the article: https://www2.physics.ox.ac.uk/sites/default/files/imce/248/c...
For neutral atoms one can for example have a tweezer whose trapping region is so small that only a single atom fits inside.
IANAPhysicist, but my guess would be, you set up your atom trap in such a way that conditions/forces/solutions to wave equation/whatever exclude any states except "no atom" and "a single atom".