The concept of "near the Sun" is quite extensible, so we will consider several options for how close a black hole can be to the Sun and imagine that a black hole just appeared in some place in the solar system, the effects of a smoothly approaching black hole would be somewhat less pronounced ... According to the modern standard, a table tennis ball has a diameter of 40 mm, if the Earth is compressed to the state of a black hole, then its diameter will be 17.7 mm, that is, a black hole the size of a table tennis ball will be several times more massive than our planet.
If such a black hole ends up in the solar system, then it will affect the orbits of all the planets in the system, depending on where exactly the black hole is and at what point in time some planets can be thrown out of the solar system and turn into rogue planets, while others on the contrary, they can approach the Sun, this fact itself does not bode well for mankind, but the changes for the Earth can be insignificant, and under some circumstances they can be imperceptible at all, for example, if this hole is at the very borders of the solar system.
If such a black hole turns out to be in the region of the inner planets, then it will cause a radical change in their position relative to the Sun and launch shrapnel from the asteroids of the main belt through the entire solar system. Because of this, all the planets will undergo a massive bombardment, combined with a change in orbit, this leaves humanity quite a little chance of survival, but this black hole is only warming up the main blow ahead.
Black holes have one distinct feature, the smaller the black hole, the greater its tidal forces. Such a small black hole will cause a burst of tectonic activity on Earth, if it is close enough to us, the structure of the earth's crust will be rapidly destroyed, huge faults will appear on the planet, through which magma from the mantle will flood the planet's surface. The faults will expand until the entire surface of the planet becomes flooded with magma, and with an even closer approach of the hole to the Earth, it will begin to tear off matter from the planet and absorb it.
But even this will not be the final blow to the solar system, being very close to the Sun, the hole will begin to pull out matter and from it, this will be accompanied by the brightest glow, torn out matter and a burst of radiation that will kill all life in the solar system.
Gradually absorbing the matter of the star, the black hole will grow and absorb more and faster, at some point the balance between the force of gravity compressing the star and internal pressure will be disturbed and the star will explode, thereby destroying the entire solar system, and the black hole, having eaten away the nearby remnants of the star's matter , will go further on his journey through the galaxy.