How do bonds form without violating the second law of thermodynamics
Note that 2 isolated hydrogen atoms will not form a stable hydrogen molecule, unless they are able to dissipate the energy, released by the bond formation. It can be done e.g.  passing mechanical energy to neighbour molecules, or emitting a photon.

In a macro scale, a system can decrease its entropy, if its Gibbs energy decreases, as it means the dissipated heat causes the bigger entropy increase of the surrounding, than is the entropy decrease of the system, so the total entropy increases.

$$\Delta G = \Delta H - T \cdot \Delta S$$

If $\Delta G_\mathrm{sys} \lt 0$ then $\Delta S_\mathrm{tot}=\Delta S_\mathrm{sys} + \Delta S_\mathrm{surr} \gt 0 $

as $\Delta S_\mathrm{sys} + \Delta S_\mathrm{surr}=\Delta S_\mathrm{sys} - \frac{(\Delta G_\mathrm{sys} + T \cdot \Delta S_\mathrm{sys})}{T}=-\frac {\Delta G_\mathrm{sys}}{T}$