In the presented article, the efficiency of the orthogonal collocation method is applied to obtain a numerical approximation of the solution to a system of differential equations. In contrast to the classical methods, which are based on using finite difference schemes, the considered approach boils down to computing a numerical approximation by solving a system of nonlinear algebraic equations. As an illustration we considered the SIR (Susceptible-Infected-Recovered) model which is used to model the spread of infection in a homogeneous population. It has been shown that the application of the orthogonal collocations method provides the optimal accuracy of the approximation of a differential equation.