"If we confess our sins, He is faithful and righteous so he takes away our sins and cleanses us from all unrighteousness." (1 John 1:9)
"Confess your sins to one another." (James 5:16)
"Confess" in 1 John 1:9 and James 5:16 are not the same Greek word.
Confess in James 5:16 means to "acknowledge openly." Within context it means apologize, reconcile, and admit harm done to others to heal your relationship with them.
Confess in 1 John 1:9 means "to agree with," "to say the same thing as God." God forgave all sin and took all sin away on the cross. So to "confess sins" here means to agree with God that sin made you need a savior and to agree with Him that Jesus, our Savior, took care of your need. The word "confess" here does not mean "recount every specific instance." It means to agree with God that you have sinned in your life and agree with Him that He has taken care of your sins on the cross. For the lost 1 John 1 is a passage for salvation. For the saved it is a passage for gratitude and the assurance of salvation.
The years when I recounted my sins I didn't think about Christ's work on the cross at all. I was sin focused and trying to get clean not Christ focused and thinking about the everlasting cleansing of His blood.