It's really not that hard to bike safely. Most accidents involve the cyclist putting themselves in a vulnerable position somehow. You can't get right-hooked by a car if you don't put yourself on its right side. Keep alert with your head up, not looking down at your phone or cycling computer or pedaling cadence. Watch all the traffic around you. You read drivers' minds when they're going to turn without signaling. Look an entire block ahead of you for any parked car showing signs of activity and potential dooring. Forget about trying to assert your right-of-way and ignore trying to make speed and time records; those don't matter; slow down and look everywhere at every questionable intersection or turn or when in a dooring zone. Keep alert and read your entire environment, and you can go years without any cycling accident. I've done it.
I have to disagree. Depending on the infrastructure and drivers you face, staying uninjured as a city cyclist is as much luck as skill.
In many places, you can do everything mentioned and still get in accidents, or the things you mention are impossible.
And while everyone who bikes will take a fall at some point, the vast majority of those actually result in only a few scratches. I know it seems terribly scary to imagine falling of a bike. But I've done so twice in about 12,000k, and the joy of biking far outweighs the pain I've suffered.