I want a help in a project

my idea is to create an automated door lock so I will attach a ir sensor and it will be connected to a sanitizer dispenser if the door will only open I the person sanitizes their hands by putting it under the ir sensor pls send the code and circuit diagram