|*Note: All controls are default, and can be changed in the Settings screen
While you can't win a fight without damaging your enemy, it is often defense that determines the victor. Avoiding or limiting damage can give you the advantage you need to swing a close fight in your favor. There are two main ways to defend: dodging and blocking.
Dodging can cost a lot of Stamina, but if done well it prevents all damage simply because you aren't hit. You can dodge at any time by pressing [SPACE] to roll. Holding a direction ([W], [A], [S], or [D]) when you press [SPACE] will cause you to roll in that direction, allowing you to not only avoid the attack but end your dodge in an advantageous position.
Dodging is not without risk, though. If you fail in your timing or direction, you will be hit just as hard as if you'd done nothing, and you will still have spent the Stamina. Masterful dodging can win a fight, but poor dodging can lose one.
Blocking is much easier, but doesn't prevent all damage. With a melee weapon equipped, you can hold [RMB] to block attacks from in front of you. While blocking, you decrease the damage the attack does by a large percentage, which depends on the weapon or shield you're using. You also spend some Stamina. However, the risk is much lower than dodging, and you hold your ground. Be careful to avoid heavy attacks, though, as these may break through your block and deal full damage.
Equipping a shield gives you the best possible blocking absorption. However, they tend to be heavy and affect your Equip Load.