Actually, in the Damage Reduction notation, the text after the slash tells you what ignores the damage reduction. So DR 5/bludgeoning subtracts 5 from weapon damage unless the weapon is a bludgeoning weapon (like a hammer, yes; all weapons will indicate their damage type).
Note that some weapons might be “bludgeoning and piercing” – these ignore DR x/bludgeoning as well as DR x/piercing, and would also ignore DR x/bludgeoning-and-piercing which neither bludgeoning-only nor piercing-only weapons would.
It’s also common to see things like DR x/magic-and-bludgeoning, which means only magic bludgeoning weapons can bypass it. Less common would be something like DR x/magic-or-bludgeoning, where any bludgeoning weapon (even if not magic) or any magic weapon (even if not bludgeoning) would bypass it.
Finally, DR x/– simply means that no physical damage type bypasses it at all.
If multiple DRs apply, e.g. you have DR 5/bludgeoning and DR 10/magic, and you’re attacked with a non-magic, non-bludgeoning weapon, only the highest applies (so you subtract 10, not 15).
Also, Damage Reduction only applies to “physical” damage, not energy damage like cold or fire. So a fireball does full damage despite DR 5/bludgeoning. Energy Resistance works like Damage Reduction (sort of) for energy damage.