Restrict the view of the LDR to block out or reduce effects from ambient light.
Did you try using the photodiode to ground a pin moded INPUT_PULLUP? How close did you have to hold the IR led and was it lit?
Search for: techwalla How to Use a Photodiode
It has step by step with pictures.