The resin in pine knots contains solvents that will bleed into and through most paints and finishes. This can cause the paint or finish to remain sticky, and it can cause the orange color to bleed through as shown in the accompanying picture of white latex paint applied over pine.
There are two types of products on the market that will block this resin: white pigmented primers and clear shellac. The most well known white primers are Kilz and BIN. The best clear shellac to use is Zinsser SealCoat because it has very little color and a longer shelf life than other shellacs.
Kilz and other brands are available as oil-based and water-based. In comparative tests I’ve found that oil-based works better at blocking the resin than water-based. But the most effective blocker is shellac, both clear (SealCoat) and white-pigmented BIN.
Once you’ve applied the SealCoat or BIN to the wood, you can apply any paint or finish over it. As long as you haven’t sanded through, this first coat should block the resin.