1994 Volvo 940 Please Help

I have a 94 volvo 940 turbo and when the car gets hot it won’t start. The engine will crank but just won’t catch and it usually happens on hot days or if i’ve been running it and then stopping it and running into the store when I come back out it won’t start it may take 5 minutes to start or most of the day. I’ve looked into what it might be and either A its a relay but I don’t know which one or B its a censor that is located behind the transmission. Any help would be greatly appreciated.

The engine may be flooding. To determine: hold the throttle down while cranking the engine. As the engine starts (hopefully) ease up on the gas. Alternatively, pull the fuel pump fuse, crank the engine until it starts (again, hopefully). Reset the fuel pump fuse, and away you go! If this works, the flooding could be caused by the fuel injector leakage into the intake during engine shutdown, or the engine coolant temperature sensor, which feeds to the engine computer, is faulty.