My friend recently told me a thought just came to her mind, of a sin she committed three years ago and is now haunting her. That's all she thinks about. She said at the time, she barely turned to Allah for help nor did it worry me, but now all she thinks about is that. She is always crying, asking for forgiveness hoping Aallah will forgive her. she told me that ever since this thought came to her, she turns to Allah way more, and prays and tries her best to read the Quran & listen to it.
Is it possible for Allah to know that at that time she committed the sin that in three years time she was going to stress about this and become a better Muslim?
Did Allah know my friend was going to struggle and beg for help in the future at the time she committed the sin?