You first need to solve the underlying problem.
Before painting, identify and repair the source of the water stain, and allow the wall to dry thoroughly. Check for signs of mold growth and damage that may require repair and remediation before you ...