This idiom means to take charge of a difficult situation and bring it under submission and control. It has been speculated that it originated in Spain or America and possibly derived from either bull running or Spanish bullfights in which the banderilleros aim darts into the necks of the bulls, then wave red cloaks and grab them by the horns to hold their heads down.
Where did that phrase come from - Take the bull by the horns