Explain how does the –OH group attached to a carbon of benzene ring activate it towards electrophilic substitution?

The –OH group is an electron donating group. Thus, it increases the electron density in the benzene ring as shown by its resonating structure of phenol.

As a result benzene ring is activated towards electrophilic substitution.