Heatstroke typically occurs when a guinea pig is housed in a cage with insufficient ventilation, or when they are caught out in direct sunlight for too long. It can also occur on extremely hot summer days, even if the cavy isn't in the sun. Typically, a guinea pig with heatstroke will have a chest that is wet from saliva. It may also run excitedly back and forth, while panting and trembling all over.
Heatstroke can kill guinea pigs very quickly, but if you can get to them in time, they can recover. First, move them to a cooler location and offer them room temperature water (drinking cold water can cause a system shock that will kill them, just as it can in humans). Dip their limbs in cool, but not cold, water, and wrap cool, damp cloths closely around the body.