I know what you’re going through cause I have scrupulosity too. It’s tough but keep following what your priest says. Also it helps to receive the Sacraments and pray the Rosary. Make sure you keep talking to your priest and following his advice.
I’d’ say if you were simply trying to remember the sin to examine your conscience, that in itself is not a sin cause otherwise we’d be sinning every time we examined our conscience for Confession!
An impure (or any) thought is a sin if you consent to it. So if you internally agree to it… say yes to it… dwell on it… or act on it. If you get a thought you can’t control and you don’t dwell on it but reject it - the thought was not in your control but the rejection was, so you have not sinned but in fact earned merit. You need to not dwell on the thought though and become strong so you can reject it right away, to avoid sin. Don’t constantly worry about this cause the worry wouldn’t help at all. Try to rely on God’s strength instead of your own and learn greater trust in Him.
Scrupulosity is hard but it can be overcome, don’t give up, and there are Saints who struggled with scruples (such as St Therese). It’s very important for a scrupulous person to speak with their priest about this so they don’t rely on their own feelings: this has been my mistake personally! Maybe next time you see your priest, you can ask about this

meanwhile try to examine your conscience with no scrupulosity or presumption, but simply and honestly, and calmly, because it’s hard to hear God when we’re so anxious. Greater trust can help with the anxiety. If you suffer from this, maybe try to offer the suffering to God for an intention, dont consent to the scrupulosity though.
God bless!