Measure the height and width of your tomato seedlings. Measure the height of a foam cup and the diameter of its smallest area, which usually is its bottom. Ensure the cup is large enough to fit over a seedling without touching its leaves or stems. Tomato leaves tend to grow outward from the main stem. So the smallest section of the cup must be wide enough to cover them.
Place one foam cup upside down over each seedling before night falls when frost is expected. Press each cup's lip into the soil, and twist each cup slightly to secure it in place. Brush soil against the outer edge of each cup's lip if necessary so no gaps are between the cups and soil. The cups help keep the plants warm by retaining heat rising from the soil; gaps let the heat escape instead of warming the tomato seedlings.
Put a rock on top of each cup. The foam cups can't protect your plants if they fall over.
Remove the foam cups early the next morning. The plants need sunlight to continue growing, and they'll quickly die if you leave them under foam cups. Frost develops overnight. So removing the cups in morning lets the plants take advantage of warming temperatures after the frost threat passes.