UV light with photo sensor

I’m designing a UV light for a refrigerator container that:
1- Turns on for 20sec after the container becomes dark and then turns off.
2- Turns off in the presence of light

I would highly appreciate some help with the code for Arduino UNO.

This is not the way the Forum works. We don't write your code for you. (Except for in Gigs and Collaborations where work is contracted). You write your code and if you Need help with it, we Point you in the right direction.

In this Situation, there is no way code could be written at all because you have provided absolutely no Details about the Project, specifically in the area of Hardware.

Are you using a particular light sensor? We can't know how to read it if you don't tell us the Hardware.

Are you using a real time clock to determine when twenty seconds pass, or is plus/minus half a second acceptable and you are planning on using something like the millis() function or delay(20000)?

I would highly appreciate some help with the code for Arduino UNO.

Have you read
Using millis() for timing. A beginners guide ?

Save the value of millis() when the container becomes dark, turn on the UV light and turn it off again when 20 seconds have passed. If the container becomes light during the period then turn off the UV light.

As above, what type of sensor are you using ? Can it differentiate between UV and normal light ? The snag is that after 20 seconds the container will become dark again and the sequence could repeat.