2003 Kia Spectra won't start when hot... sometimes

My Kia Sopectra (manual transmission)has an intermittent starting issue. When the weather is hot, and I have been driving it long enough to warm everything up, It won’t start again. It won’t crank, won’t do anything when the key is turned. THe radio and all other interior stuff still works. I took it to a shop, and they replaced an “ignition sensor”? (I forget the actual name), but the next warm spell, it started happeneing again. I had heard that a bad fuel pump relay can cause this, so I bought one and swapped it out the next time it happened, and it seemed to work… BUt then it happened again the next time I dorve it.

Any other ideas, or things I cna try?

Is there a way to test a relay when I take it out? Besides just putting it in a different slot?