Usually it’s fine. If the pill itself isn’t damaged (not crushed, leaking, or discoloured) and you keep it dry and out of heat/light, taking it tomorrow should be okay. If it’s a soft capsule or you’re unsure, the leaflet or a pharmacist can confirm but most tablets don’t need to be thrown out just for being exposed to air briefly.