There are a variety of weapons Joel and Ellie can use in The Last of Us. Taking full advantage of each means understanding what enemies to use a weapon on, and how it's most useful. Some weapons are more useful in stealth, while others are only viable options if you're ready to attract an audience.
Here, we'll break down the entire list of weapons and which to use on which enemies:
Pistol - This is one of the first and one of the weakest weapons in the game. It's effective against many different enemy types, but only if you have enough rounds to stop the monster or hunter in his tracks. For example, Clickers can take more than one pistol headshot before falling. Popping a human in the head with the pistol can kill them in one shot, but only if your aim is true. Be wary when using the pistol on anything later in the game.
Revolver - This gun is a step above the pistol, but has the same weak points. You're not guaranteed to bring anything down with less than a headshot, and it certainly won't have the stopping power to end a Clicker as you might hope. Like the pistol, the revolver is good for use when you have the drop on someone. Pop off a headshot and it'll bring the human Hunters down, but be ready for the rest of the group to come looking for you (if you haven't already taken care of them).
Shorty - This handheld shotgun is helpful in controlling crowds or ending aggressive Clickers. You can fire off a quick burst and bring a close-range enemy down in a flash, but don't expect the shorty shotgun to be effective on anything at long range. Enemies that happen to be wearing body armor won't feel much of Shorty's blast either. Once you've upgraded your holsters, you can keep Shorty in a secondary slot to switch to as a last ditch effort, but it doesn't carry much ammo anyway so you'll be forgiven for ignoring this weapon.
El Diablo - This scope-equipped pistol is great for long-range firefights, where you can get a reticle on an enemy at long range. Scoring a headshot is really effective, but many lower-level enemies will fall with a simple blast to the chest as well. Overall, El Diablo isn't great for the awkward, stuttering movement cordyceps infection brings on, but it's great for use against human enemies (of which there are a lot in The Last of Us)
Bow and Arrow - This is one of the most over-powered weapons in the entire Last of Us campaign. It can be used in stealth and outright combat (though it's much better and more useful in stealth). It can be used against all enemies, though humans make the easiest targets. Once you've upgraded the Bow and mastered the stealth maneuvers Joel has at his disposal, you'll be nearly unbeatable.
Shotgun - No zombie apocalypse would be complete without the shotgun. Once you've crafted a few upgrades for this weapon, it can be quite over-powered. It's effective against all types of enemies, especially infected, but it can come up short when used against foes with body armor. Use it against bloaters and unload your buckshot into anything that moves to bring it to a stop.
Hunting Rifle - It's recommended that you use supplements to improve Joel's weapon-sway and aiming before relying too heavily on the hunting rifle. It's rounds have tons and tons of stopping power, but that won't be very effective if you miss. The hunting rifle is great against both humans and infected, but humans are likely to move more predictably and therefore, make better targets.
Flamethrower - I would only use this on infected enemies, and more specifically Clickers and Bloaters. Of course, if you've dealt with all but one or two Hunters in an encounter, you might wanna start a campfire before Joel and Ellie move on to the next area. Light 'em up.
Assault Rifle - You get this gun very late in the game (at least I didn't pick one up until Salt Lake City). At that point, it's only usable on human enemies, but remember to fire in bursts to conserve ammunition. Burst Rifle - There's an alternate assault rifle that only fires in bursts, much like the two-shade assault rifles available in Uncharted.
Machete - This is an extremely powerful melee weapon, killing most enemies (but not Bloaters) in one hit. All it takes is a slice and a dice and make a kick to push an enemy off your blade. I would save these for aggressive infected, but if a human's running you down, it might be good to tap the Square button and show his friends what happens when you lose your head in a fight against Joel.
Switchblade - Ellie's weapon is great for stabbing, but not much else. You can fight other enemies with it one-on-one, but sneaking up and ending them in stealth is much faster and also doesn't put Ellie at risk of further attack.
Shiv - This is perhaps the most important weapon in the game, but mostly because it also acts as a tool. When you can craft shivs, you should. Always carry one (though two or three is certainly preferable). You can use these to open doors that contain valuable stashes of supplies, but you can also defend against charging clickers (once you've upgrade Joel through supplements). In fact, you should probably upgrade these above any other weapons so that they don't break every time you use one to kill a Clicker in stealth or in all-out combat.
Hatchet - This axe acts like the Machete, so use it in good conscience, but remember that once you've used it up, it's gone.
Planks - Planks suck, don't use planks unless you have no other melee weapon at your disposal. The only reason you should use an un-Melee-upgraded plank is because you'd otherwise be relying on your fists (which are even worse than Planks).
Upgrade the plank with binding and blade to give it a little extra oomph against enemies.
Pipe - Pipes are heavy and have plenty of durability for repeated use, but just like any other melee weapon, they can break on you when you need them most.
Upgrade the pipe with binding and blade to create an instant-kill melee attack.
Baseball Bat - Pretty much exactly what I said about the pipe. Remember to watch the durability meter!
Upgrade the pipe with binding and blade to craft another instant-kill melee attack.
Molotov Cocktail - These are essentially a get out of jail free card, when it comes to killing Bloaters. Bloaters and other enemies can wander over the pool of fire and relight, even after you ignited them with your initial toss. Make sure to maintain a balance between using Alcohol and Rag supplies to craft these and first-aid kits. You'll need plenty of both throughout the game, so be smart about using each.
Nail Bomb - These are essentially land mines, you can toss them at enemies directly, or throw them away to distract and eventually kill enemies. If you make a bad throw, always remember to go back and pick these up, because if they're not detonated you can add them back to your inventory easy. These are effective against all types of enemies.
Smoke Bomb - I didn't use these very much, but they're good against human enemies that you want to sneak by. Since Clickers use echolocation, they won't be very bothered by the clouds of sugar these bombs create.
Bricks, Cinder Blocks, Bottles - These throwable objects have two uses: distraction and stun. You can throw these at nearby enemies with a tap of the triangle button. This will stun them and allow Joel to close the gap and finish the enemy off with a single punch (on very low level infected and Hunters) or with a blow from a melee weapon. Obviously you can toss them away from your location and distract the AI as well, but once you get a handle on combat, it can be very easy to start playing aggressively taking out enemies in a free flow and these items are central to that rhythmic ballet of death.