Many years ago, when I was a young, a fresh rider, on my first bike, a Yamaha YSR 50, I was rear ended. I was in a right turn lane, had momentarily stopped checking to see if it was clear to proceed. I was struck at slow speed by a mini van. Force was enough to damage the tail section of the bike, and I only found myself running forward after being dismounted from the bike. I was lucky.
These days, now that I have started commuting on a bike / scooter, I wear a high visibility jacket and helmet, and helps that the scooter is red. As mentioned above, while at a light, I check my mirrors frequently, and pulse the rear brake light as cars approach from behind. While traveling, I keep a good margin incase traffic comes to a halt, so that I don't have to jam on the brakes, and worry about the car(s) behind me. Observation, most cars keep a decent cushion behind me as well. I appreciate that.
The other risk is cars merging into your occupied lane. I position myself either ahead, or behind adjacent cars, while in motion. I constantly scan and observe other drivers intentions, and heed to my gut feeling ... or in other words, my spidey senses.