The short answer is that you can’t. With that being said, there are preventative measures you can take to avoid your car smelling terrible.
Always keep your windows down while smoking. After smoking, keep them down for 20-30 minutes. Never leave cigarette butts in your car even if you have a built-in ashtray. And, if you do notice ash after smoking, immediately vacuum and wipe down hard surfaces using the steps above.