Just moved this over to the landscape technique area.
My best tip for photographing sunsets (or sunrises since it's the same sort of technique) is to work with the sun below the horizon. My second best tip is to make sure that there's something interesting in the foreground, especially something that has a good shape because you may wind up with a silhouette in your shot. And then there's the reason that you'll probably get a silhouette which is that you'll probably have to underexpose in order to get the colours of the sunset.
Sunrise:
Sunset: