The answer is 1-With ice and immobility.
The cause of shin splints is stress on your tibia and the connective tissues that attach the muscles to that bone. Resting your body (especially because the exercise could be what caused the stress) and put ice will reduce the inflamation, swelling and the pain. Another treatment could taking anti-inflammatory painkillers.