Have you ever photographed someone in front of a sunrise, sunset or window and the person you’re photographing comes out dark?
The issue is that the person you are photographing is much darker than the brighter area in back of them.
You should base your exposure on the bright area, this is best done working in manual exposure mode in a spot metering pattern, and then add light to the darker area (the person) with your flash.
You can easily do this with the flash that you have built into your camera if you are close enough to the person.
If you have a separate, more powerful, flash unit, you can be farther away.
Learn to work your camera in manual exposure mode