Memantine is a medication primarily used to treat moderate to severe Alzheimer's disease by acting as an NMDA receptor antagonist, which helps regulate the activity of glutamate in the brain. This regulation can improve cognitive function and reduce symptoms associated with neurocognitive disorders, making it an important component in the management of these conditions.