James 5:16 Therefore confess your sins to each other and pray for each other so that you may be healed. The prayer of a righteous person is powerful and effective.
Why is it so powerful to confess a sin(catholic doctrine)?
The Catechism of the Council of Trent gives these reasons:
Necessity Of Confession
Contrition, it is true, blots out sin; but who does not know that to effect this it must be so intense, so ardent, so vehement, as to bear a proportion to the magnitude of the crimes which it effaces? This is a degree of contrition which few reach; and hence, in this way, very few indeed could hope to obtain the pardon of their sins. It, therefore, became necessary that the most merciful Lord should provide by some easier means for the common salvation of men; and this He has done in His admirable wisdom, by giving to His Church the keys of the kingdom of heaven.
According to the doctrine of the Catholic Church, a doctrine firmly to be believed and constantly professed by all, if the sinner have a sincere sorrow for his sins and a firm resolution of avoiding them in future, although he bring not with him that contrition which may be sufficient of itself to obtain pardon, all his sins are forgiven and remitted through the power of the keys, when he confesses them properly to the priest. Justly, then, do those most holy men, our Fathers, proclaim that by the keys of the Church the gate of heaven is thrown open, a truth which no one can doubt since the Council of Florence has decreed that the effect of Penance is absolution from sin.
Advantages Of Confession
To appreciate further the great advantages of confession we may turn to a fact taught by experience. To those who have led immoral lives nothing is found so useful towards a reformation of morals as sometimes to disclose their secret thoughts, all their words and actions, to a prudent and faithful friend, who can assist them by his advice and cooperation. For the same reason it must prove most salutary to those whose minds are agitated by the consciousness of guilt to make known the diseases and wounds of their souls to the priest, as the vicegerent of Christ our Lord, bound to eternal secrecy by the strictest of laws. (In the Sacrament of Penance) they will find immediate remedies, the healing qualities of which will not only remove the present malady, but will also have such a heavenly efficacy in preparing the soul against an easy relapse into the same kind of disease and infirmity.
Another advantage of confession, which should not be overlooked, is that it contributes powerfully to the preservation of social order. Abolish sacramental confession, and that moment you deluge society with all sorts of secret and heinous crimes crimes too, and others of still greater enormity, which men, once that they have been depraved by vicious habits, will not dread to commit in open day. The salutary shame that attends confession restrains licentiousness, bridles desire and checks wickedness.
Scriptural support for confession (the sacrament of Penance and Reconciliation) includes John 20:23 and Matthew 16:19:
"John 20:22-23 -- And when he had said this, he breathed on them and said to them, "Receive the holy Spirit. Whose sins you forgive are forgiven them, and whose sins you retain are retained."
Matthew 16:19 -- I will give you the keys to the kingdom of heaven. Whatever you bind on earth shall be bound in heaven; and whatever you loose on earth shall be loosed in heaven."