At least do not interfere with him: do not devalue thoughts and actions, do not focus attention on them, do not joke about behavior and rituals, do not try to say that all this is nonsense, and with a strong desire, you can just take and stop thinking about something or do something. The best thing you can do to help in this situation is to give acceptance and support
If you are not a psychiatrist, then you cannot seriously help him. OCD is a personality disorder that a doctor treats. In general, Gestalt therapy and cognitive behavioral therapy do a good job of this. A positive result is very possible.
But about behavior - here you can really be more loyal to this person, more tolerant. Just by knowing about him like this.
Don't judge him. In no case do not ridicule his desire to bring everything to perfectionism and ideality. Such a person can wash their hands 50-100 times a day. For him, this is a way to deal with his inner anxiety. Also be understanding about this.
Remember that he is essentially a hostage to his fears and worries. He himself would be glad to stop all this, but he cannot because of the peculiarities of his psyche. You will not ridicule and condemn a person for coughing and fevering during a cold, right? It does not depend on him. This is just how the disease proceeds. Here is something similar. It is beyond his power to just stop it. Only working with a specialist will help him to overcome this ailment (if I may say so).
To summarize: do not condemn, do not freak out, be more tolerant and condescending. This is pretty much all you can do. But, believe me, by doing this you will greatly help the person suffering from obsessive-compulsive personality disorder.