Live in an area without noise and air pollution. Stay in shape. Don't eat lead paint chips. Have smarter children and train them to inherit your legacy[1].
Modafinil probably doesn't boost intelligence, but you'd have to define intelligence first. It increases "executive function" and decreases some other things like creativity and reaction times.
Twenty years ago I heard stories about people taking Piracetam, but afaik it's for Alzheimer patients and not healthy individuals looking to boost their intelligence.
Importantly, we don't know about anything that can "boost" intelligence. We only know some things that can help not harm your intelligence. Eating a healthy diet is the biggest, others have named things like avoiding pollution.
Modafinil probably doesn't boost intelligence, but you'd have to define intelligence first. It increases "executive function" and decreases some other things like creativity and reaction times.
https://www.sciencedirect.com/science/article/abs/pii/S09249...
[1] This is a better strategy than relying on your own intelligence, because you're only ever one blow to the head away from losing it.