Ketamine acts mainly by blocking NMDA receptors in the brain, which interrupts the transmission of pain signals and induces a trance-like state. It also interacts with opioid receptors and monoaminergic pathways, contributing to its analgesic and mood-stabilizing effects. The complex mechanisms make ketamine effective in a variety of settings, including potential applications in neonatal intensive care units (NICUs).