Rent a ozone machine. All you need is 24 hours. Full paint with a paint additive to help combat smell issues. Fogers also help, but ozone machine is your best bet. Our carpet cleaning company rents one to us.
It could be coming from another apartment adjacent to that one. Ozone machine will help delete the current smell but won’t off set the long term if neighbors are smoking.
Definitely do an ozone - and I agree, if you don’t own one, get one! We use ours often. Also - this is so silly, but we had an apartment that stunk horribly - they were even so bold as to leave a large bud on the counter when they left - we bought break & bake cookies and started making cookies a couple times a day in there. Totally worked!!! And the apt smelled great when we showed it!
It depends on the severity. For our worst smoking units, we oil sealed walls, pulled carpet and pad, sealed the floor and put down new carpet and pad. For a bad cat pee unit, we actually had to replace the ceramic tile too. Also, degreaser cleaner on cabinets and appliances. Then, after the turn was done, we ozone gassed the unit for 2 runs of 4 hours each. Good luck!