This is a question I get frequently from athletes. There are a lot of recommendations when you have an injury or soreness from running. I will try to give you my two cents.
Hot- applying heat to any tissues can improve circulation to the area and reduce tension in a tissue. If you have an injury or soreness this can assist with tissue repair and recovery by bringing repair cells to the area quicker. It may also reduce spasm in a muscle. It is ok to use heat right away after injury if it feels good. You can use hot bath, whirlpool and hot packs. Be sure to watch the area to avoid burns with heat packs.
Cold- ice and cold packs can reduce blood flow to an area and create an analgesic effect. If your main complaint is pain or excess swelling, this may be a good choice. If it feels worse after, maybe try heat next time. I wouldn’t cool an area more than 10 minutes at a time.
Of course, when in doubt, ask a physio!
Your community Physiotherapist,