Betta fish have a love-hate relationship with light. They require an ample amount of light during the daytime while they are awake but prefer it to be pitch black at night so they can get a good night’s sleep.
You’re not limited to sunlight with your betta fish, though. You also have the option of using artificial light to keep him happy. Just keep in mind that artificial light will need to be turned off and on manually unless you opt for artificial light with a built-in timer.