When a massive star runs out of fuel, it can’t keep itself puffed up against its own gravity. The core collapses inward. For stars below a certain size, the core stops at a neutron star - incredibly dense, but still a “thing” with a surface. For stars much bigger - generally about 20 times the mass of our Sun or more - even neutron pressure can’t stop the collapse, and the core keeps falling inward until it becomes a singularity: a point of essentially infinite density with no size at all.
That’s a stellar-mass black hole. The outer layers of the star, no longer supported, get blown off in a colossal explosion called a supernova, while the core squeezes down into something so dense that not even light can escape its gravitational pull.
This is what most known black holes are: dead massive stars. The Milky Way alone is estimated to contain about 100 million stellar-mass black holes, scattered throughout the galaxy, each one the corpse of a giant that once shined. The supermassive black holes at the centers of galaxies probably formed differently - they’re a separate type, much bigger, and likely grew from smaller “seeds” over billions of years.