This study will be a prospective randomized controlled trial evaluating the effectiveness of using Headspace before and after undergoing total knee replacement surgery. The purpose of this study will be to determine whether using Headspace will help to improve functional outcome scores, decrease pain, and decrease opioid medication use after total knee replacement in patients with depression and/or anxiety. Headspace is a smartphone-based application that guides individuals through various mindfulness sessions and has been shown to reduce symptoms of depression, anxiety, and pain.