How does one know for sure if they have OCD and if it's linked to anxiety?

I noticed and became self-aware about the little quirks I have. Such as preforming small tasks so I won't feel really uncomfortable. Ex. blinking a specific amount of times so there won't be a ''consequence'' following.
Asked by Kansas

Diagnosing Obsessive Compulsive Disorder is difficult to diagnose as it may present as symptoms of other diagnoses. Obsessive-compulsive disorder (OCD) features a pattern of unwanted thoughts and fears (obsessions) that lead you to do repetitive behaviors (compulsions). These obsessions and compulsions interfere with daily activities and cause significant distress. You may try to ignore or stop your obsessions, but that only increases your distress and anxiety. Ultimately, you feel driven to perform compulsive acts to try to ease your stress. Despite efforts to ignore or get rid of bothersome thoughts or urges, they keep coming back. This leads to more ritualistic behavior — the vicious cycle of OCD. Clinically Obsessive Compulsive Disorder Symptoms: Symptoms can be either obsessions or compulsions, or both Symptoms can be mild and gradually progress in severity Stress worsens the symptoms Persistent, repeated and unwanted thoughts Urges or images that are intrusive Compulsive or ritualistic behavior to get rid of the thoughts As with obsessions, compulsions typically have themes, such as: Washing and cleaning Checking Counting Orderliness Following a strict routine Demanding reassurance Examples of compulsion signs and symptoms include: Hand-washing until your skin becomes raw Checking doors repeatedly to make sure they're locked Checking the stove repeatedly to make sure it's off Counting in certain patterns Silently repeating a prayer, word or phrase Arranging your canned goods to face the same way This needs to persist over time. To have a concrete diagnosis you would need to speak to a medical professional to evaluate the compulsion/obsession fully. Obsessive Compulsive Disorder can be linked to anxiety if the compulsion or obsession cannot be completed or accomplished. The anxiety can also come from frustration of not being able to control the thoughts associated with the compulsion. Stress and anxiety trigger and worsen obsessive compulsive disorder so it is important to be mindful of this. The best thing to do now is to try and manage your stress and keep an accurate diary of your symptoms and issues so that when you discuss them with a specialist they have an idea of what's going on and how to help you.