Zoloft (Sertraline hydrochloride) is used to treat depression, cephalexin 500 mg pill anxiety disorders, and cephalexin 500 mg pill obsessive-compulsive disorder. Zoloft belongs to a group of medicines known as selective serotonin reuptake inhibitors (SSRIs). It works by increasing the amount of serotonin in the brain