Cameras are getting better all the time, but they still can’t cope with the contrast of a setting sun when the sun is too bright. So, keep taking photos even when the sun has dipped below the horizon, at this point in the sunset the contrast is much reduced. Try obscuring the sun partly behind an object to reduce its brightness and get a starburst.
It’s natural to look in the direction of the setting sun when taking photos but always keep an eye on the sky in other directions. Depending on the clouds and conditions the sky can be colourful in any direction, though this can be a bit frustrating when you have gone to a location with a particular focal point in mind!
If you can afford one, get a good quality graduated filter can be used on the camera to darken the sky when taking the picture. This reduces the contrast problem, enabling the camera to capture what you saw. If you are good at photoprocessing try taking two photos of the same scene; one slightly darker than the other. You can then merge the two photos using the darker photo for the sky and the lighter one for the foreground. You should use a tripod for this.