How does one make a perfect act of contrition without being distracted by fear of hell, loss of heaven, etc.? Is it impossible for some people?
St. Thomas Aquinas was once asked to write a treatise on how to become a saint. According to the story, he was provided with a richly-bound volume full of blank pages on which he was expected to spill much ink on the question of achieving sanctity. When he returned the volume, the inquirer was surprised to find just two words: “Will it.”
Aquinas’s answer applies to your question as well. One makes an act of contrition by willing to do so. A person cannot help the feelings, such as fear, that distracts him; but he can fully will to say and mean “God, I am sorry for offending you. Please forgive me my sins.”
Imperfect contrition (i.e., attrition) is not caused by temptations to fear. It is caused by only being sorry because one got caught, or because one dislikes the consequences, or for some other imperfect reason. Attrition is sufficient for receiving sacramental confession, but contrition (sorrow for sin because one has offended God) is necessary when sacramental confession is not possible.
The difference between contrition and attrition is illustrated by the parable of the Pharisee and the tax collector. Both men intended to pray to God and seek his mercy, but the Pharisee felt that mercy was his due because he considered himself to be a basically good guy while the tax collector simply threw himself at the feet of God out of sorrow for offending him:
[Jesus said]: “Two men went up into the temple to pray, one a Pharisee and the other a tax collector. The Pharisee stood and prayed thus with himself, ‘God, I thank thee that I am not like other men, extortioners, unjust, adulterers, or even like this tax collector. I fast twice a week, I give tithes of all that I get.’ But the tax collector, standing far off, would not even lift up his eyes to heaven, but beat his breast, saying, ‘God, be merciful to me a sinner!’ I tell you, this man went down to his house justified rather than the other; for every one who exalts himself will be humbled, but he who humbles himself will be exalted” (Luke 18:10-14).