Obsessive-compulsive disorder (OCD) is a type of mental illness that causes repeated unwanted thoughts. To get rid of the thoughts, a person with OCD does the same tasks over and over. For example, you may fear that everything you touch has germs on it. So to ease that fear, you wash your hands over and over again.