The following are possible causes. Try a solution according to the circumstances.
If the flash setting is Off: If set to Off, the flash will not work evben if dark.
Change the flash setting to On, and then see if the flash will work.
If the flash cannot be set to On for a reason such as Intelligent Auto mode being set, change to Program Auto.
On some cameras, the flash unit will need to be raised manually first.
If set to a shooting mode where flash cannot be used: The flash setting is fixed to Off in some shooting modes, such as when set to High Sensitivity/ Night Scene/ Fireworks/ Anti Motion Blur in Scene Selection, Continuous Shooting, or Bracket.
Change the shooting mode or setting.
If the issue is still unresolved, the product may need to be repaired.