How to stop resinous knots from staining through the #Paint? Kind of easy but not without its pitfalls.

2 coats of shellac sealer ie Zinsser BIN or clear shellac knotting. Apply a thin coat fast no fuss. It dries by evaporation , fast. Give It 10 minutes then apply second coats. Again, thin and fast with no fuss. Aerosol is good if you have a lot to do
Water-based stain sealers are trickier to use and less effective.
In both cases, the trick is to lock in the stain into the first coat. Shellac dries really fast so It locks tve stain in fast. Wáter based sealers take longer to cure, day(s) not minutes. If you apply second coats and the first has not cured you literally reactivate the stain.
BEST demo of successful wáter based stain sealers was a coat of Zinsser Bullseye 1-2-3 over nicotine. Left for a week it looked horrendous, but tve staining was locked in and the second coats left It super White and problem solved