Rewriting methods in higher algebra