One of the more difficult things that new players have trouble remembering is that moving away from an opponent will draw an opportunity attack. As soon as players hear that moving their character more than one square away from an adjacent creature will result in that creature getting a free attack, all tactics that involve moving are thrown out the window. It’s almost as if they believe that drawing an attack and possibly taking the hit is the absolute worst thing that they can do on their turn.
As an experienced DM I’m going to tell you that you need to be willing to take an opportunity attack once and a while. From a mechanics point of view all opponents know as well as you do under what circumstances they’ll get to make a free attack on you. If you move away they’ll attack you as soon as your back is turned. If you try to use a ranged attack while standing next to them, they’ll see the hole in your defenses and attack you. And if you try to crawl away while prone you bet that you enemy will kick you as you scurry away.
But so what if they do? In most cases a monster’s basic attack is just that – basic. It usually is a straight up weapon attack, be it a sword or claw. Yes, it has the potential to hurt you but you need to weigh that against the value of taking the action that draws the attack in the first place.