If it sounded like it was running out of petrol it's most likely a blocked breather tube. Next time it happens unscrew the petrol cap an try starting it, if it fires right back up you'll know it's the breather tube.
To cure the problem just cut the breather tube at forty five degrees.