Praise be to Allah.
Al-Shanqeeti (may Allaah have mercy on him) said:
Allaah says (interpretation of the meaning):
“And remember your Lord when you forget”[al-Kahf 18:24]
There are two well-known scholarly views concerning this aayah:
One of which is that this aayah is connected to that which comes before it, and it means that if you say, “Tomorrow I will do such and such” but you forget to say “in sha Allaah”, then after that you remember, you should say “in sha Allah”. In other words, remember your Lord, connecting everything with His will concerning what you want to do tomorrow, when you remember after having forgotten. This is the apparent meaning, because it is what is indicated by the preceding aayah (interpretation of the meaning):
“And never say of anything, ‘I shall do such and such thing tomorrow’” [al-Kahf 18:23]
This is the view of the majority, and among those who expressed this view were Ibn ‘Abbaas, al-Hasan al-Basri, Abu’l-‘Aaliyah and others.