Online games as multimedia can create high interest in users, especially online games that use interaction. This if done in the long term will result in negative impacts. Currently, there are many online game competitions known as esports. The players who are involved with esports are referred to as professionals, although their playing time is the same as online game addicts, they are different from ordinary online game addicts. So, in this article, the author constructs a mathematical model of online game addiction into four compartments (susceptible, infective, professional and quitting compartments) by considering the direct transfer of the vulnerable population to the professional population. The author conducted a stability analysis of the model equilibrium point where there are two equilibrium points and also obtained the basic reproduction number . By using Pontriagin's maximum principle, a solution for optimal control is obtained using control variables and in order to obtain an optimal condition.