As the growth of society and the continuous upgrading of people’s living standards increase, people’s requirements for indoor environment are also increasing. To optimize the ventilation methods inside buildings, a numerical simulation method was used to construct numerical simulations of airflow organization and aerosol diffusion, and based on this model, better ventilation methods were determined. To optimize the determined better ventilation method, a multi-constraint optimization model was constructed using infection probability, thermal comfort, energy utilization coefficient, and velocity non-uniformity coefficient. The ventilation method was optimized through multi-objective constraints. To solve the optimization model, an optimized particle swarm algorithm was studied and designed. The results showed that under the “air rain” flow field, the maximum values of aerosol particles at the human body, bed surface, and outlet were 171, 769, and 19,973, respectively, while the minimum values were 4, 169, and 2197, respectively. The “air rain” flow field is a better ventilation method. The maximum and minimum values of the original non-uniformity coefficient were 0.44 and 0.08, respectively. After optimization by the particle swarm optimization algorithm, the maximum and minimum predicted non-uniformity coefficients were 0.457 and 0.08, respectively. The original value and predicted value are very close. The numerical model and algorithm constructed by the research institute are effective. The algorithm designed by the research institute can provide technical support for multi-objective optimization of indoor ventilation methods.