Do it right away before you forget.

Literal

Not-forget [while-うちに] immediately that [object-を] do-[soft-command-なさい]

Minimal example of the 忘れないうちに pattern with a plain verb. すぐに adds urgency. Both the doer and what 'it' refers to are omitted — the sentence is pure imperative stripped to its skeleton.