If you were Catholic at the time you contracted marriage outside the Church and without a dispensation, then the Church does not recognize you as married. This is because Catholics are bound by both civil and Church law and are thereby required to marry in the Church or to receive a dispensation to be married outside the Church. As such any sexual relations with your legal wife would be an act of fornication. You will need to speak to the priest, but if you go to confession while in an invalid marriage without intent to rectify the situation then any absolution is invalid. You cannot withhold a sin or not have an intent to amend and still be absolved.
I mention the above not as a condemnation, but rather to explain that your situation will likely require more than just confession.
It is good that you want to be a good example to you son. Part of that will be to follow all the teachings of the Church… including her teachings on marriage and morality. Going to confession is certainly an important part, but it won’t help him to follow that example if you also don’t set an example on how to live a holy life in all it’s aspects. Being a good example is noble, but you should want to live a holy life for your own sake, and more importantly out of love for God.
The first step is to meet with your pastor and explain the situation. Based on your specific circumstances, he can walk you through what is required to set things straight.