Infrared obstacle avoidance sensor module Applications - Smart door lock

I am making my own smart door lock with fingerprint sensor, led ring and Infrared obstacle avoidance sensor (IR sensor). I came up with the idea that when there is someone approach the door with a specific distance, the IR sensor will activate the fingerprint sensor, then with the correct matched fingerprint the door will be opened. If someone is out of the range of the IR sensor, fingerprint sensor will deactivate to save energy.
That’s my idea so far but I am new to Arduino, can any one help me out with the code please, I really appreciate that <3