How can I prevent Pneumocystis carinii pneumonia?

There is no vaccine available to prevent Pneumocystis pneumonia, but it can be prevented in patients with HIV or other immunosuppressed patients by using medications such as compound sulphamethoxazole.