Why is there more matter than antimatter? Calculational methods for leptogenesis and electroweak baryogenesis