What I normally do is something I like to call threat level calculation. It sounds complicated but is very simple, let me explain. If there are 3 zombies and 1 creeper, I will normally try to kill the creeper first because if it blows up it can do massive damage to you. I will usually use a sword on creepers because I can do a critical hit once, run away, then hit it twice quickly, and kill it (with a bit of practice you will almost never fail at this). I will use an axe on skeletons to get a quick kill, I typically dodge the first arrow, then rush in and about 75% of the time I won't get hit. Spiders are simple to kill, 2 normal axe hits usually result in a kill.
Now here is where the "threat level calculation" comes into play, what you need to do is look around you and figure out what's going on, see a skeleton with an enchanted bow? Kill it first before you focus on the zombies. Notice a creeper sitting on a ledge? Get your bow and kill it before it can drop down and blow up. Spiders are slightly faster than other mobs, so I will usually end up having to target them first because they are always the first ones to be close to me. If you notice a zombie in full armor with a sword, ignore everything else and kill it first (unless there is a creeper on a ledge in a cave, they will blow up instantly, possibly killing you before the zombie can). Don't be afraid to run away, dig down into a hole, or place water. Get a bow and lots of arrows, a bow and arrow is your friend since you can snipe most mobs before they are a threat. If you're going to be running around at night, make sure to have lots of food, at least full diamond armor and weapons, and a lava bucket. Enderman hit like a truck on hard and they are fast, a simple shield won't protect you, make sure you have good armor, a shield (if you have really good armor you can skip a shield and place a bow in your offhand), and food, preferably golden carrots.
Something else I like to do is carry around different weapons in my Hotbar and my offhand, I will have a Smite V axe in my offhand for the undead, and a Sharpness V sword in my main hand for everything else (I also like to have a Bane of arthropods V Axe/Sword, it's ability to one hit kill spiders is nice, especially on hard mode, you don't know when a spider can have strength or speed). I also like to keep at least a stack of enderpearls in my inventory, a well placed enderpearl can save your life if you're low on health and surrounded by lots of mobs (make sure to have feather falling IV on your boots so you don't take as much damage from the pearl, or you'll end up dying to the pearl instead!).
Something else you can do is carry around iron blocks and pumpkins, if your feeling overwhelmed, you can create a few quick iron golems to act as an aggro sponge, and a good tank to soak up some damage and throw out some good punches of its own. Carry around a notch apple and a totem of undying, these can also save your life in both PVP and if you're being attacked by too many mobs. Keep a map and make sure to mark where you came from with torches, blocks, and so forth. I don't want to turn this into a full-on survival guide because it's already 4 paragraphs, but these should help you stay alive quite well.