In this paper, we establish a mathematical model of online game addiction with two stages to research the dynamic properties of it. The existence of all equilibria is obtained, and the basic reproduction number is calculated by the method of next‐generation matrix. The global asymptotic stability of disease‐free equilibrium (DFE) is proved by comparison principle, and the global asymptotic stability of endemic equilibrium (EE) is proved by constructing an appropriate Lyapunov function. Then we use the Pontryagin's maximum principle to find the optimal solution of the model, so that the number of infected people can be minimized. In numerical simulation, firstly, we validate the global stability of DFE and EE. Secondly, we consider three kind of control measures (treatment, isolation, and education) and divide them into four cases. The models with control and without control are solved numerically by using forward and backward sweep Runge‐Kutta method. In order to achieve the best control effect, we suggest that three kind of measures should be used simultaneously according to the optimal control strategy.