Major depressive disorder is a public health issue that negatively impacts quality of life and leads to cognitive impairments, causing significant disruptions in work, education, and social life. Treatment-resistant depression is defined as the failure to achieve improvement in depressive symptoms despite the use of at least two different antidepressant medications at adequate doses and durations. Current pharmacological approaches are inadequate for about half of treatment-resistant depression patients, and the effects of these medications on cognitive impairments are limited. Therefore, there is a need for new and effective treatment methods. This review aims to evaluate the effects of ketamine and esketamine on cognitive functions in the treatment of treatment-resistant depression patients. Relevant literature has been reviewed and recent studies have been evaluated. The results of randomized controlled trials indicate that ketamine is effective in treating treatment-resistant depression and can improve specific cognitive domains. Significant improvements in cognitive functions such as visual memory, processing speed, working memory, and attention have been recorded in patients responding to 0.5 mg/kg ketamine infusion. However, long-term use of ketamine may have negative effects on spatial working memory. Esketamine, an NMDA receptor antagonist, has shown rapid and effective antidepressant outcomes, providing stability or improvement in cognitive functions. Additionally, its intranasal administration offers practical advantages. However, findings suggest that high doses of esketamine may have neurotoxic effects and negatively impact cognitive functions. The effects of both drugs on depressive symptoms and cognitive functions vary depending on dose, duration of use, and frequency of administration. In conclusion, while ketamine and esketamine show significant potential in the treatment of treatment-resistant depression and improvement of cognitive symptoms, further research is needed regarding their long-term effects and safety.