Lectures on generalized symmetries