Unrighteousness is basically un-Christlikeness, because Christ is our righteousness. If Christ is our righteousness, then we in our self are unrighteous. To be purified of unrighteousness is to be purified from our self.
So we should confess during the day, moment by moment, whenever we are in our self and not in God.
We normally think of sins as lust, greed, lying etc, and think we only need to confess these.
But we also need to confess our naturalness, our lack of spirituality, our prayerlessness. Whenever we've gone through the day with little thought of God, we need to confess that we are too much living in ourself and by ourself. The unadulterated truth and focal point of Paul's ministry was that God lives in us, but we grieve and quench Him so many times, and need to confess that, to regain an awareness of His living within us.
The wrong reason to confess, is because we think we have been naughty and God will punish us if we don't confess, or we will lose some blessing or reward. The right reason to confess is because we have offended the one who loves us the most, and we want to be in full communion and fellowship with Him and regain His presence in our life.
Confession is another way to enter into the presence of God, like thanksgiving and praising.