The book Fluent Forever introduced me to a simple game (mnemonic) for this exact problem. The author suggests devising a specific, contrasting concept to attach to each gender (or it could be any other mundane grammatical concept with a small number of options).
- Masculine nouns burn. Feminine nouns are ice cold.
- Masculine nouns are fast. Feminine nouns are slow. Neuter nouns travel in reverse.
Come up with your own, then study the nouns (or other concepts) consistently, visualizing your mnemonic.
From the book:
I want you to imagine all of the masculine nouns exploding. Your tree? Kaboom, splinters of wood everywhere. A branch gets embedded in the wall behind you. Dog chunks splatter all over the ceiling and floors. You wipe bits of fur and gore from your forehead. Make your images as vivid as you can stomach.
Feminine nouns should catch fire. Your nose spews fire out like a dragon, a flaming cat sets fire to your bedroom. Feel the heat of each image; the more senses you can involve, the better.