しまわない

not end up (doing), not (do) completely

→ 仕舞う
auxiliary · informal Rare #44,502
not end up (doing), not (do) completely Used after a verb’s て-form. Often refers to avoiding an unwanted or unintended result.
JA: 忘れてしまわないように、メモしておこう。
EN: I’ll make a note so I don’t end up forgetting.
Conjugation of 仕舞う

明日までにこの作文を書いてしまわないといけないんだ。

I have to finish writing this essay by tomorrow.

眠ってしまわないように気をつけなさい。

Be careful not to fall asleep.

それで、時間がたって忘れてしまわないよう、書き留めた。

So I wrote it down so I wouldn’t forget as time went by.