To be specific, if you honestly forget, yes you are forgiven, but you still must confess at your next regular confession, so you don’t need to go as soon as possible like when you have just committed a mortal sin, but simply at your next regular confession…one thing you didn’t mention though, was it a mortal sin you forgot to confess? because if it was venial, then in that case you are not obligated to confess those in the first place, though it’s highly recommended…i’m sure you meant mortal though, but just to make sure.