What chemical is found in coffee and soft drinks that prevents some people from falling asleep?

The chemical found in coffee and soft drinks that prevents some people from falling asleep is caffeine.

Caffeine is a stimulant that blocks adenosine, a neurotransmitter that promotes sleepiness. When caffeine blocks adenosine, it increases alertness, focus, and energy levels.

While the exact effects of caffeine vary from person to person, it's generally recommended to avoid consuming it several hours before bedtime to ensure a good night's sleep.