Overheating

how do i know if i have a head gasket leaking, my truck overheats daily, but just once, then it’s fine rest of day. it is not the thermostat.