I tripped on my sandal and now the middle of my foot hurts when I walk, but should I ice or heat it?

Ice. Ice is better after an acute injury. No longer than about 20 minutes per hour and not directly on the skin. If the pain does not improve, see a specialist for an evaluation.