Hot water sets some stains while dissolving others. For instance, when choosing hot or cold water for blood stains, selecting hot could cause the stain to “cook” into your clothes.
Many stains respond best to a rinse or soak in cold water, then a wash cycle in warm or hot. See this guide about pretreating and removing multiple types of stains.