As a pedestrian, the first thing you should do to stay safe is to always obey the signals at a crosswalk. Do not try to dart across the road just because it looks clear. Wait for the walk signal, when you know you have the right of way and cars have been stopped at the light.
Of course, even doing this isn't perfect. One of the main reasons that pedestrians get hit is when drivers do not yield the right of way to them, even though they are in the crosswalk.