That’s a good question. It happens to me often enough that I wake up from an awesome dream (lucid or not) and think I’ll definitely remember that, even though I can’t write it down straight away for one reason or another. And then when I finally get to journaling I can’t remember the content at all, only that I really wanted to recall it.
What sometimes helps is to identify a key element of the dream and memorize this a deeply as possible while you still have the memory. This one straw may later be enough to trigger the entire memory to come back. My results with this trick vary quite a lot, but sometimes it works wonders.
Tldr: don’t try to keep the whole dream in memory but only an important piece to later retrieve the whole thing