Again, those words are not in Scripture. But Scripture does contain the following:
All this is from God, who through Christ reconciled us to himself and gave us the ministry of reconciliation; 2 Corinthians 5:18 The Ministry of Reconciliation is administered through the Church Christ established through His priesthood
Also many of those who were now believers came, confessing and divulging their practices. Acts 19:18
And when he had said this, he breathed on them and said to them, Receive the Holy Spirit. If you forgive the sins of any, they are forgiven them; if you withhold forgiveness from any, it is withheld. John 20:22-23
What is interesting, is that the only way someone knows whether to forgive or retain a sin is to HEAR IT. This is the Sacrament of Confession Christ established.
YES....it is written that you should confess your sins.
NO...it does not have to be to a priest. At least not in the Bible.