Because of the surpassing greatness of the revelations, for this reason, to keep me from exalting myself, there was given me a thorn in the flesh, a messenger of Satan to torment me—to keep me from exalting myself! 2 Corinthians 12:7 (NASB)
In 2 Cor 12 Paul is telling about the thorn in the flesh that he was given. In the preceding verses Paul was telling the Corinthians of his trips to the third heaven. He had been in the place where God dwells and he had surpassing great revelations.
These kind of things could cause a man to become prideful (smile). Paul was keenly aware of the danger of his flesh to become prideful and to flaunt this before the other apostles and believers in Christ.
Can you imagine having that conversation with the Sons of Thunder? “What have you guys been up to? I have been to the third heaven where God dwells, how ‘bout you?”
We are all capable of such pride. When we have those mountaintop experiences, or especially a string of them, we can become a bit haughty.  Paul was no different. He was human and according to Romans 7:14 he did struggle with the flesh!  There were times Paul still desired to sin and there were times he did sin.
God, in His wisdom afflicted Paul with whatever the thorn in his flesh was to keep this from happening, to keep him humble. We don’t know for sure if it was physical affliction or a church issue, or a literal messenger of Satan. What we do know that Paul was begging for relief from it. Three times he asked God for relief. 
Our hearts are so naturally bent on pride anyway that is doesn’t take too much to put us over the top. No doubt Paul was at risk for such a thing after such a glorious experience.
Paul began to understand that the purpose of this particular affliction was to humble him. Suffering is a humbling thing. It brings you to the end of yourself.
Humility born of suffering is an aspect of character in a godly person; the person God is shaping you into. In 1 Peter 3:8 (NASB) Peter outlines what that person looks like:
…harmonious, sympathetic, brotherly, kindhearted, and humble in spirit; not returning evil for evil or insult for insult, but giving a blessing instead.
In Philippians 2:3 Paul says,  Do nothing from selfishness or empty conceit, but with humility of mind regard one another as more important than yourselves; 
We don’t naturally put others before ourselves, and when we are told we are prideful we become indignant and deny it.  
Our hearts are so rebellious… The heart of pride is a devastating thing in a Christian.  God knows we are prideful. As has been said before we want to be independent and self-sufficient and there is no place for either of those in the life of a believer.  Invariably pride is the number one cause of the problems that bring people to counseling, and the other roots stem from that single devastating tap root. 
If you recall, pride is what turned the most beautiful angel God created into Satan! Pride is one of those sneaky things that we disguise as other things. We call it control, self-centered, being shy, perfectionistic, and independent, self-sufficient and so on. The world has disguised pride as having low self-esteem.  We place such a high value of ourselves-independent of God. 
We need to be humbled. The heart of pride must be vanquished.