If your enemy top laner is strong enough to the point that he can dive on you, burst you from 100 to 0 in one combo, and survive the turret damage, then that probably means they are already significantly higher than you in gold and/or levels.
I think your problem is not just knowing how to play safe when you fall behind, but how to play safe from 0:00. Learn how to trade, how to control your wave placement during early game, how and when to harass or engage, and when you just need to sit back and farm while trying to deny your enemy laner as much damage as possible. Consistent gold from minions is worth far more than gold from kills, and the gold and experience and pressure lost from death hurts far more than losing a few CS.
Play safe from the beginning, and learn to respect your opponents before you even test their skill.