Hit it with a stain blocker. Loads out there my favourite is Zinsser bullseye 123 or zinsser BIN, but have a look in your local DIY store plenty to choose from. Do two coats then hit it with your topcoat.
If it is nicotine it may bleed through the first coat but will be locked in and the second will block it.
123 is water based easy clean up, BIN is solvent based, brushes need cleaning in methylated spirit, slightly harder to apply but better for things like resin and knots.