This man could not help himself. He was totally controlled by demons, thousands of them. So violent and so strong was it that the other human beings could not control him either. He was in torment - totally controlled and he had no free will of His own. This is why Jesus confronted such situations. It is all of Jesus, not of human effort. He wanted people to see what He could do and who He was in situations where people had no control. He places us in circumstances that are totally beyond our authority and control, mainly to show us that He is in control.
Demons, by the way, cannot possess a believer because the Holy Spirit lives inside of a believer and possesses a believer. But Satan can harass us and hassle us from the outside in circumstances, mental pressure, emotional pressure, physical pressure, and circumstantial pressure. But from the inside we have Christ. All of this is to pressure the human side of life, not the spirit side of life.