This paper is devoted to optimal control of dynamical systems governed by differential inclusions in both frameworks of Lipschitz continuous and discontinuous velocity mappings. The latter framework mostly concerns a new class of optimal control problems described by various versions of the so-called sweeping/Moreau processes that are very challenging mathematically and highly important in applications to mechanics, engineering, economics, robotics, etc. Our approach is based on developing the method of discrete approximations for optimal control problems of such differential inclusions that addresses both numerical and qualitative aspects of optimal control. In this way, we establish necessary optimality conditions for optimal solutions to differential inclusions and discuss their various applications. Deriving necessary optimality conditions strongly involves advanced tools of first-order and second-order variational analysis and generalized differentiation.