I agree with Doc J. What you may have is multiple problems.
Dying when idling can be the result of several things, chief among them being problems with the idle air control system, vacuum leaks and incorrect timing. Fuel could be an issue too but usually you will have driveability problems as well since it takes more fuel to drive than to idle.
Failing to restart when hot is likely a totally different problem. Often I find this is due to the starter getting too hot. On old cars and trucks you would have a heat shield for the starter.