2004 Hyundai Santa Fe intermittently won't start

My Santa fe was running fine and when I got in to start car or wouldn’t turn over. All the dashboard light came on. Windows rolled up and down but no start. After 15 minutes and calling a wrecker, it started. Happened again today in a parking lot. Sat for 30 minutes to see if it would atart. Called towing and had to wait another hoir. Finally started an hour later right before the truck arrived. Took to get it checked this morning. They couldn’t find anything wrong. Any ideas?

The next time the engine won’t start, with the dash lights on, step on the brake pedal and shift the transmission into neutral, and then try starting the engine.

If the engine starts, the problem is with the transmission range switch.

Tester

Also check and clean battery connections. The other option is to wack on the starter. If that works you need a new starter.