A black hole is a singularity in space that has collapsed in on itself and created a large gravitational field, from which no matter, including light, can escape.
Source: NASA
How do black holes form?
Stars perform what we call fusion. The hydrogen atoms fuse into elements with larger atomic numbers, and then an energy is released, which pushes the atoms inside the star out, but the star does not grow any larger, because of the star’s gravitational pull. Gravity does not allow growth.
After a while, the hydrogen atoms inside the star are depleted, the reaction slows down and the internal balance of the star is disturbed, which causes the star to succumb to its own gravity and collapse in on itself.
This event is called a Supernova. Supernova is an important factor in the release of elements. The formation of the element gold is observed here.
The Crab Nebula is a Nebula that derives most of its energy from pulsars, formed by the remnants of 1054 supernovae… It is 6,500 light-years from Earth. (Wikipedia)
This is simply how black holes form, and of course, each process has different and amazing details!