Ketamine primarily works as an NMDA receptor antagonist, blocking the neurotransmitter glutamate in the brain. This action disrupts normal communication between neurons, leading to its characteristic dissociative effects. It also interacts with other receptors, such as opioid and dopamine receptors, contributing to its analgesic and euphoric properties.