In this paper, we give a unified approach to study the controlling algebras and cohomology theories of various types of operators on 3-Lie algebras, including relative Rota–Baxter operators of weight 0, relative Rota–Baxter operators of nonzero weight λ, twisted Rota–Baxter operators, Reynolds operators, derivations, crossed homomorphisms and homomorphisms. The main ingredient is deformation maps of quasi-twilled 3-Lie algebras. More precisely, we introduce two types of deformation maps of a quasi-twilled 3-Lie algebra. Left deformation maps unify relative Rota–Baxter operators of weight 0, relative Rota–Baxter operators of nonzero weight λ, twisted Rota–Baxter operators and Reynolds operators. Right deformation maps unify derivations, crossed homomorphisms and 3-Lie algebra homomorphisms. Furthermore, we give controlling algebras and cohomologies of these two types of deformation maps, respectively, which not only recover some existing results, but also lead to some new results, e.g. the controlling algebras for twisted Rota–Baxter operators and Reynolds operators on 3-Lie algebras.