One of these will definitely solve the problem
Fix Screen Brightness Keeps Changing Automatically
Is your Windows 10 screen automatically dimming for no reason? Chances are you have adaptive brightness enabled on your PC, but there are other reasons why your screen may be dimming automatically.
Whatever the cause, there are a few simple solutions you can apply to your PC to prevent it from automatically dimming. One of these methods should solve the problem.
Windows 10 comes with a feature called adaptive brightness that automatically adjusts the brightness of your display. When this option is enabled and your environment changes, Windows automatically dims your screen.