My 2001 ford ranger just died in the middle of traffic?

I'm having multiple issues with the truck, mostly because I haven't had the money for the upkeep. But it just died on me, the lights and everything come on, and it's trying to start although it sounds really weird when its trying to start. It had almost no oil in it so put two quarts in, no luck. The battery light came on right when it quit, and I've had this happen before a few times, but it started right back up the previous times. I'm thinking maybe a bad alternator?

How old is your battery?

Its brand new.

What engine do you have?