You can spend a move action to go into a defensive stance. This stance last until the start of your next round, or until you move.
When you are in a defensive stance, you can defend against one attack as a reaction. You may choose to do this after an enemy has made an attack and hit you, but before damage is rolled. The defense will either be a dodge, or a block. A natural 20 on a defense roll is an automatic success. You cannot defend against an attack that hit with a natural 20.
Roll d20 + dex bonus + dodge AC bonus with a DC equal to the opponent’s attack roll. On a success, the opponent’s attack misses.
Choose a weapon or shield that you are wielding to block with. Roll a standard attack roll with that weapon against a DC equal to the opponent’s attack roll. On a success, the opponent hits (and potentially damages) the item that you were using to block. Resolve the damage as a successful Sunder attack. Even if the item is broken, you are not hit.
Fighting Defensively and Total Defense
The dodge bonuses from Fighting Defensively and Total Defense are also added to Block rolls.