Generally, most prepared cyclists carry a spare tube, some tire levers and a bit of money or something else that could be used as a tire boot. With these, if you have a damaged tire or tube, you can normally put in a new tube and continue your journey. For tubeless riders, a spare tube is sometimes necessary. A pump or CO2 cartridge is necessary to inflate the tire. CO2 is nice because its quick, and you can reseat a tubeless tire if necessary with one, but it is wasteful and once you're out of cartridges, you have to go to a pump anyway. I carry both, just cause a small pump can be tiring on your arms.
A patch kit is useful but usually you end up replacing the tube on the road and patching it at home so that the patch is reliable.
Another use of a frame pump is to get dogs to go away.
In any case, I leave mine on my bike normally so its always there (its a mini, and attaches to the underside of my rack, so nobody sees it). If I'm riding around town, I won't carry a spare tube or levers since its less of a hassle just to walk the bike home or catch a bus, but when I go out of town, I carry them just cause there aren't many options to get home without fixing the flat myself.