Screen flickering on a Mac system is oftentimes caused by compatibility issues between the operating system and the installed GPU (Graphics Processing Unit). If that is the case, check for any software updates as newer driver versions usually bring performance optimizations while also fixing bugs, glitches, and other issues. To see if such updates are available, go to the application Store or select the Apple menu followed by System Preferences. If a macOS update has been released, download and installs it. A good safety measure is to always back up your data to an external drive or a cloud storage service before installing a major OS update.
Other potential solutions for the problem include restarting your Mac or shutting it down completely, waiting for a couple of minutes, and only after that booting it up again.
In some cases, the screen stopped flickering after a reset of Mac's PRAM (or NVRAM). To start the process, shut down your computer. Now, as soon as you start it back up, press the Option+Command+P+R keys on your keyboard and hold them for approximately 20 seconds. If everything was done correctly, the system will start with the PRAM (or NVRAM) being reset.
On MacBook Pro, the screen flickering might be caused by a malfunction in the Energy Saver settings. One such example is the 'Automatic graphics switching' option found in Energy Saver that will cause the Mac to alternate between two different graphic chips. To disable the setting, open 'System Preferences' and go to 'Energy Saver.' Locate 'Automatic graphic switching' and uncheck the corresponding box.