Deriving Effective Hamiltonians for Strongly Correlated Materials: A Systematic Schrieffer-Wolff Approach