An obvious difficulty when taking a photograph that includes the sun is that it’s fairly bright. I mean, that’s pretty obvious, I guess, but what do you do about it. It isn’t just bright, it is very, very bright. If you shorten the exposure so that the sun doesn’t overwhelm the photograph, then the rest of the sky becomes very dark.
One obvious thing to do is wait for a sunset when the sun is rendered darker due to atmospheric conditions. At times like that, the number of stops between the brightness of the sun and the sky is reduced to a more manageable amount. Even so, there is still a difference. I confess to cheating a little for this image. In the original the sun is nearly pure white, still having been overexposed a bit. But I took various exposures, including one that is three f/stops darker (1/3200 of a second instead of 1/400). The sun you see in this image came from the darker image, while the rest is from the lighter. It works, though, because that’s actually the way our eyes see the scene, having more dynamic range than camera sensors.