First you make sure that it's not primed or cocked, and then you drop a long dowel down the muzzle, and mark it at the crown. Then pull it out and hold it alongside the barrel with the mark even with the muzzle end. If the other end of the rod doesn't come even with the breech end, there's a powder charge and a projectile in there.
It's obviously easier with revolvers, whether cartridge or cap 'n' ball, since you can observe the contents of the chambers directly.
When self-loading pistols were first introduced, a lot of thought went into various ways to ascertain the chamber's status without having to cycle the action. Many early autos, like the Luger, had extractors that doubled as visual/tactile loaded chamber indicators.
Savage's Model 1907 pocket auto originally had a clip that encircled the breech, shaped kind of like a pocket clip on some pens, with a tab that extended rearward and would be forced outward by the rim of a chambered round.
Later models dispensed with it, as it required separate machining steps to both the barrel and slide, added an extra part, and could tie up the slide if the finger-like indicator tab were to break off.
Besides, loaded chamber indicators are very much a "trust but verify" sort of thing, as far as I'm concerned. I'd rather check the chamber manually regardless.
.