The risk of contact infection among susceptible individuals in a randomly mixed population can be reduced by the presence of immune individuals and this principle forms the fundamental of herd immunity. The conventional susceptible-infectious-recovered (SIR) model features an infection-induced herd immunity model, but does not include the reducing risk of contact infection among susceptible individuals in the transmission model, therefore tends to overestimate the transmission dynamics of infectious diseases. Here we show that the reducing risk of contact infection among susceptible individuals can be achieved by incorporating the proportion of susceptible individuals (model A) or the inverse of proportion of recovered individuals (model B) in the force of infection of the SIR model. We numerically simulated the conventional SIR model and both new SIR models A and B under the exact condition with a basic reproduction number of 3·0. Prior to the numerical simulation, the threshold for the eradication of infectious disease through herd immunity was expected to be 0·667 (66·7%) for all three models. All three models performed likewise at the initial stage of disease transmission. In the conventional SIR model, the infectious disease subsided when 94·0 % of the population had been infected and recovered, way above the expected threshold for eradication and control of the infectious disease. Both models A and B simulated the infectious disease to diminish when 66·7% and 75·6% of the population had been infected, showing herd immunity might protect more susceptible individuals from the infectious disease as compared to the projection generated by the conventional SIR. Our study shows that model A provides a better framework for modelling herd immunity through vaccination, while model B provides a better framework for modelling herd immunity through infection. Both models overcome the insufficiency of the conventional SIR model in attaining the effect of herd immunity in modelling outputs, which is important and relevant for modelling infectious disease, such as the COVID-19 in a randomly mixed population.