Speak to people that know Gemaros. They won’t let you forget what you’ve learned.
Topics that you relate to stick better. Some people can remember Gemaros that have intersting scenes. Others remember a Gemara that had a funny word. Some relate better to a Chiddush and can remember those Sugyos that had interesting Chiddushim.
When you are Mechadesh you also remember it better. ???? ???? ???.
The Gemara in Megilla says that saying the Gemara out loud with a tune helps you remember it.
Don’t let yourself forget a Gemara. By this, I mean that when you remind yourself of a Sugya you just climbed out of and you can’t recall a certain detail, don’t say, ‘whatever’. Look it up.
Sof Kol Sof, remembering is from Seyata Dishmaya as Rebbe Yehoshua said to the people in Alexandria, and as the Gemara says in Megilla.
If a particular passage starts getting complicated and you see no way out, come back the next day and start over.