Towel and a magnet. Every headset I redo on a bike that I haven't worked on before, when I remove the top hardware, I keep upward pressure on the forks so the steer tube doesn't slip down and spill bearings everywhere.
Then I take a strong magnet lower the forks slowly, and grab all the bearings.
Works in hubs, too. Especially old ones with no grease left. Take the cones off one side without pulling the axle out, then wiggle the axle while catching the bearings with the magnet.