When the sun sets, our eyes go from color to black and white, like changing the film in a camera. Your night vision works differently from your day vision, so you may have good day vision but bad night vision. Since we are not night animals, our night vision is not very good.
Riding at night is different from riding during the day. In particular, at night our depth vision gets much worse, so you cant judge the distance of oncoming cars very well, or their speed. How far away is that car and how fast is it coming towards you? At night you know less than you think. So be extra careful when pulling into a traffic flow or changing lanes at night.
Some drivers forget to dip their headlights for oncoming traffic. Some headlights are badly set so they shine into your eyes anyway. Some big trucks have lights so bright they are naturally blinding. And sometimes the headlights of a car coming up a hill shine at you even when dipped. One way or another, sooner or later, if you ride at night you will encounter blinding headlights. Don’t look at them, as one tends to go where one looks! Look to the side of the road, to the line of the road markers, or look to the traffic ahead. Fix your vision on a point of the road that you can see, and focus on that.
Sunrise and sunset are particularly dangerous, as when the sun shines in your eyes you cant see. On a bike you can temporarily raise your left hand to shade your eyes, but it is dangerous to ride like this. A better option is to drop your head so the top of the helmet acts as a sunshade. Or just squint. The flip side of this problem is if the sun is setting behind you, the other traffic cant see you. So if the setting or rising sun is behind you, give other drivers especial latitude.