How do I avoid getting rearended?

The first two were daytime, I was stopped at a light. The last was 6 pm but it was dark since it was December .