Black holes are objects of enormous mass, and therefore strongly attract other bodies. Indeed, if any sufficiently large black hole attracted the Earth or any other planet or even a star, it would "absorb" it. And yet black holes do not pose any increased danger to mankind at all. There are two reasons for this:
First, a collision with any cosmic object, even a much smaller mass than a black hole, such as a large asteroid, another planet, its satellite, or a star, can also lead to the complete disappearance of life on Earth. Therefore, there is no particular reason to be separately afraid of an encounter with a black hole (after all, it does not really matter whether a black hole "sucks" the Earth into a singularity, or whether it burns up inside another star). Thus, if anything to fear, it is any cosmic encounter.
The second reason, even more important. An encounter with a black hole, for the Earth, is the least likely of all possible cosmic encounters. The fact is that black holes, as has already been said, are very massive objects. They are comparable in mass or larger than stars. Objects of such mass cannot sneak up unnoticed, they will first long act on the external object by their gravity, changing the type of its motion. Such "sneaking up" may eventually last for millions of years before a black hole takes over the "sucking in". And at the moment, no one interferes with the calm and uniform rotation of the Earth around the Sun, i.e. no one sneaks up on us.
Thus, the main thing to understand about black holes in the aspect of their danger to the Earth is that such massive objects as black holes do not roam the cosmos, on the contrary they form the laws of motion of other bodies by means of their enormous attraction. As a result, it turns out that other bodies as if "wander" around black holes. So, for example, in the center of our Milky Way galaxy there is just a huge black hole, around which everything rotates.
It is also important to note that other bodies are not exactly "wandering," but are moving in accordance with the fundamental laws of nature, along specific well-established orbits. Our galaxy is no longer young, and its motion is already well-established. This means that all bodies have already formed due to mutual attraction some general pattern of motion, in which each has its place, and collisions of large objects actually do not occur.
Everything that should collide has already collided, everything that should be absorbed by black holes has already been absorbed, and other large bodies, such as stars and black holes have spun around each other in a steady dance.
This is why we are least in danger of colliding with a black hole or another star. But with small objects like asteroids, collisions are possible. This is something to be feared, and methods of deflecting such a threat need to be developed. Fortunately, many scientists are doing this. In this aspect, the most important thing is to keep an eye on the asteroids. It is being actively and carefully monitored. Also, ways to change the trajectories of dangerous asteroids are already being developed. Mankind should achieve significant progress in this way in the coming decades.