Compunction comes when you consider how much you have grieved God Who is so good, so sweet, so merciful, so kind, and entirely full of love; Who was crucified and suffered everything for us. When you meditate on these things and other things the Lord has suffered, they bring compunction.
I had wasted much of my time and devoted almost all of my youth in acquiring knowledge which now appears as just foolishness before God. Then one day I awoke suddenly, as if from some deep sleep, and saw the intense light of divine truth, and realized the absolute worthlessness of all the wisdom taught by the leaders of this world. I wept many tears for the wretchedness of my life and prayed for some guidance to lead my life to faith. The first thing I did to reform my previous way of life was to mix with the poor...
The way to attain compunction is an attentive life. ‘The beginning of repentance comes from the fear of God and attention,’ as the holy martyr Boniface says.