Do FIDE rules ban stimulants? Which ones? Do FIDE rules ban stimulants?   I think they ban 'drugs',  but would coffee be okay?   What about beer or wine?
I hope they ban smoking somehow now.
And I would think that NADH could help old grandmasters play much better.  Do not think there is any test for that either.
So what does FIDE ban and what can players take to stay alert  and play better ?
FIDE (and probably most of the national federations) would very much like chess to be an Olympic sport because that would lead to massive injections of money into the sport. Hence they subscribe to WADA and have defined drug testing protocols for chess.
The document Chess WADA – Anti-Doping Policy, Nutrition and Health gives details of banned substances relevant for chess:

The 2018 WADA Prohibited List and Monitoring Program can be found at:
http://list.wada-ama.org/
The most relevant banned substances for chess are:

Amphetamines – e.g. Adderall, Ritalin

Ephedrine and Methylephedrine – Prohibited by WADA when its concentration in urine is greater than 10 micrograms per milliliter

Pseudoephedrine is prohibited when its concentration in urine is greater than 150 micrograms per milliliter

Modafinil


Substances not present on the Prohibited List but represented in the Monitoring
Program:

Caffeine – Included in WADA Monitoring Program and relevant for incompetition testing only. Any urine test reading of less than 12 micrograms per milliliter poses no problem.
Codeine – A common ingredient in, for example, preparations used to treat coughs and stomach upsets. Any dosage is highly unlikely to be significant when taken in normal therapeutic quantities.


You say:

I hope they ban smoking somehow now.

Smoking is obviously banned in the playing area but is permitted in the playing venue if there is a designated smoking area. This is actually spelled out in the COMPETITION RULES section of the FIDE Laws of Chess:

11.3.4 Smoking, including e-cigarettes, is permitted only in the section of the venue designated by the arbiter

Not every tournament will have a designated smoking area although tournament organizers generally try and also not discriminate against smokers and vapers.

what can players take to stay alert and play better ?

The first and most obvious requirement for full mental alertness is adequate good quality sleep. FIDE has published its recommendations in Effects of Nutrition and Exercise on Cognitive Performance. There you will find FIDE's common sense guide to good nutrition and hydration.