The procedure is a standard safety measure, as the probability of crashing is higher during takeoff and landing, pilot Rohan Bhatnagar said on social media. He explained that in a crash, when lights go out, it takes time for the human eye to adjust to complete blackout; dimming the lights beforehand allows for quicker evacuation. According to Daily Express - Travel, pilot and author Patrick Smith described that dimming the lights allows passengers' eyes to pre-adjust to darkness, so they are not suddenly blinded if power fails and they must dash for exits in darkness or smoke.
The emergency path-lighting and signs also become more visible, and it helps passengers maintain a basic sense of orientation, such as which way is up. Multiple reports indicate that the dimming makes emergency exit signs and floor path markers more prominent. While the practice is widespread, it is unclear whether official regulations require it or if all airlines follow the same procedure.
Dimming the lights allows your eyes to pre-adjust to darkness, so that you're not suddenly blinded if something happens and the power goes out, and you're dashing for the doors in darkness or smoke. The emergency path-lighting and signs will also be more visible. And it makes it easier to see outside, which helps you to maintain at least a basic sense of orientation – i.e. which way is up.
The exact timing of when lights are dimmed before takeoff and landing also varies, and no specific scientific study has been cited to quantify the effectiveness of the measure.