What muat I do to prevent ear pain on an airplane due to sinus infection?

Decongestants. You can try taking decongestants before the trip (e.g. Pseudoephedrine). I don't usually recommend nasal decongestant sprays, but they might be reasonable to take before take-off and landing.