Control systems are mechanisms that enable realization of desirable behaviors from dynamical systems, such as automobiles, robots, and manufacturing processes; although invisible, they are often essential for our daily lives. Control engineering involves the analysis and design of control systems, and optimal control is one of the important problems in control engineering. In an optimal control problem, the control input is determined to minimize a cost function given certain constraints. Even if a mathematical model of the control system is known, it is generally difficult to find its optimal control input owing to heavy computations or data storage, and the development of efficient algorithms for optimal control problems has been an active area of research for several decades. Realization of optimal control for dynamical systems by adaptation or learning is challenging when their mathematical models are unknown; moreover, developing practical optimal control methods for unknown dynamical systems is a challenge both in control engineering and machine learning. Therefore, control systems provide ample motivation and opportunity for machine learning. This tutorial aims to help researchers and engineers in the field of machine learning tackle problems in control systems. An overview of the problems and concepts in control engineering is provided first, and the specific benefits of control methods without learning are outlined; the primary focus here is on model predictive control (MPC) based on real-time optimization, which has rapidly developed in recent years. MPC can address various control problems beyond traditional control objectives, such as regulation and tracking, and is applicable to a wide class of dynamical systems if real-time optimization is feasible. Typical applications of MPC include mechanical systems based on detailed nonlinear models, such as drones, automobiles, and robots, with sampling periods of the order of milliseconds. Moreover, MPC enables optimal control performance and is often used as a reference for learning-based control methods. Against the backdrop of these current achievements, a discussion on the ideas and methodologies of control engineering, which can prove beneficial to machine learning, will be carried out.