If it is in a closet and you want it to come on when the door opens, you might get a door jamb switch. That would be off when the door is closed and on when it is open.
I installed several of these (in some closets, under the kitchen sink, under the bath sinks) and they were instantly popular with my wife.https://www.aliexpress.com/item/DIY-Stick-on-Anywhere-Portable-10-LED-Wireless-Motion-Sensing-Closet-Cabinet-LED-Night-Light-Stairs/32602596392.html?Run for 6+ months (and still going) on 3 AAA batteries with typical light usage. (Daily usage might be more, but they're not battery hogs for sure.)