Lightsabers are the most revered weapons in the Star Wars universe. It's why they're the weapons of choice for the most powerful wielders of the Force. Though they're seemingly unrivaled, that's not entirely the case - they're not magic, after all. Yes, there are, in fact, different kinds of armors and weapons that can beat a lightsaber, or at the very least withstand them. Some of the coolest Star Wars weapons aren't even lightsabers, for that matter.
Let's face it, it would be pretty lame if the Jedi were able to win every single fight by virtue of their indestructible weapons. There needs to be some drama!
Let's take a look at what can stop a lightsaber: weapons and armor, and the material they're made of. You might be surprised by how unexpected some of these things are. On the other hand, you might not be. It is Star Wars, after all.
Mandalorian iron, or "beskar" in native Mando'a, could only be found on its namesake's planet or its moon. It is a very durable material and thus capable of withstanding lightsabers. The Mandalorians used it in their weapons, armor, and starships.
Cortosis is a type of ore that actually causes lightsabers to short out upon contact. However, it is brittle, so repeated strikes would ultimately break it. It was often woven into body armor, most notably for shadowtroopers. Purified cortosis was called Cortosis-Shield and was used by Roan Fel's Imperial Knights.
Phrik is a material that doesn't just boast an awesome name, it's also lightsaber resistant. It was a very light metal that was generally forged into armor more than weapons, but Palpatine's lightsaber was made of it. It was so strong that a container of phrik actually survived the destruction of Alderaan.
IG-100 MagnaGuards wield electrostaffs, weapons with electromagnetic pulse generating tips. They are made of a phrik alloy, a lightsaber-resistent material in its own right. General Grievous wielded an electrostaff, as did Count Dooku's bodyguards.