2012 Hyundai Veloster slows down while driving

i have a 2012 hyundai veloster when driving it starts slowing down .i press the gas it wont go anymore. i put the flashers on turn the car off .and start it again put it in drive it wont go …i turn it off sit a few minuets and try it again then it goes what is causing this

Could be dozens of things. If you aren’t going to work on it yourself, and I’ll assume your aren’t, take it to a good independent mechanic and tell him what you told us here. It may take him some diagnostic time to find the problem (we would just be guessing) but you’ll get a better understanding of what is wrong and what needs to be fixed.