MB3 195a: Doing Melacha When One Loses Track of the Days (344:1-2)

When one loses track of what day is Shabbos he can only work enough to make what you need for that day. If he knows he left a specific number of days ago but doesn't remember what day of the week it is.

Doing a lesser amount of melacha before it becomes an emergency vs. waiting until it's more urgent.