VW Passat trouble starting

Over the past few weeks, every few times I start the car it takes me a long time to start it. I turn the key and it makes the noise that it is going to start, but it just takes an extra long time. Once it starts the ESP light (I think?) which I read in the manual means it is running on a lower energy level. I thought at first it was my battery so I had a new one put in. But that didn’t help. It doesn’t happen all the time, but just today, it happened again and then when I was parking my car just died in the lot. But as soon as I took the key out and started it again, it started right up. Any ideas??