One Morning I was driving on my way to work . I
slowed my car down to go over the rail road track
but when I pressed the gas my car wouldn’t go
anywhere.So I pulled to the side of the road and
cut my car off . I then tried to turn it on but still
nothing it wouldn’t crank but everything come on
Your question doesn't give much information to work with. But most of the time when this problem arises suddenly, it's a dead or dying battery; you might have enough juice to light the lights, but not enough to turn the starter motor. Jump start the car properly; leave donor hooked up long enough to charge your battery, at least ten minutes. If your car starts, fine. If it does not start, replace your battery. After either of these, go to an auto parts store and have any codes read. They may point you to the reason your battery died. In your case, I'd suspect it's a bad alternator.