Black holes are formed when extremely large star dies. When a star dies, it first expands, then contracts. Large stars contract until their atoms collapse, pulling the electrons into the nucleus. The immense strength of the gravitational force of a black hole pulls all nearby matter in, even light (which has mass).
Black Holes, black holes are formed when a really really big star dies. So let's talk first the Physics of of stars and how they keep stable.
Our sun has been burning for about 10 billion years and it's can continue to burn for another 5 billion years or so and there are some forces involved in there like there's gravity it's a very large and the gravity is pulling towards the center of the sun, is our sun right? But there's also nuclear fusion right? Hydrogen colliding forming helium and that energy that force is going out and so our sun is in balance okay as it starts to run out of fuel the gravitational force is going to decrease and it's going to expand and become what we call a red giant it will at that point suck in the earth and all the inner planets and become much much lager in size and then as that red giant runs out of fuel okay? That outward force dies and now we just have gravity again pulling it back in and put the sun it will end up as a white dwarf, it will be very small and it won't shine very bright and it will remain that way for a long period of time.
However, if it's a really big star that has a lot of mass it's going to do something a little bit different and it's going to form a black hole. What happens is that mass is so large that all of those atoms are going to get pulled together and usually an atom is mostly space of the electrons but they're very very tiny mass in the middle so like if I'm standing in the middle of a huge stadium I'm the nucleus everything else is the electrons, well this mass is so big the gravitational force is so strong that these atoms are going to get pulled together so there's virtually no space between the atoms and the gravitational force becomes infinite. What does this mean? This means that the gravitational force in that black hole is so strong that it can pull virtually all objects into it even energy forms like light cannot pass by a black hole it'll get pulled into that black hole because of the immense strength of the gravitational force of that black hole and that in short is what a black whole is.