Why spit-up stains set so easily
Spit-up is mostly milk, and milk contains proteins and fats that cling to fabric. Warm water and heat can set those proteins, which is why a stain that looks faint can become permanent after one hot wash or a trip through the dryer. Acting early and checking before drying are the two most important habits.
Rinse and scrape first
Scrape off any thick residue with a dull knife or the edge of a spoon. Then rinse the spot from the back of the fabric with cold water. Rinsing from the back pushes the stain out the way it came in, rather than deeper into the fibers.
Do not rub the spot vigorously, especially on delicate knits. Gentle pressing is enough.
Pre-treat before washing
Work a small amount of liquid laundry detergent into the stain with your fingers or a soft brush. Let it sit for about 15 minutes. Some people prefer an enzyme-based stain remover made for protein stains, which can help with milk residue. Follow the product label. Test any product on a hidden seam first, especially on colored or printed fabric.
Avoid chlorine bleach on colored baby clothes unless the label allows it. On white cotton, a bleach product can help, but check the care label first.
Wash, then check before drying
Wash the item according to its care label, using cold or warm water depending on the fabric. Before you put it in the dryer, look at the spot in good light. If any mark remains, do not dry the item. Repeat the pre-treatment and wash again.
Heat from a dryer can set a milk stain that is still visible. Air drying is the safer choice until you are sure the stain is gone.
Stains that linger
Some spit-up stains take more than one round of treatment, especially on fabric that has been left for a day or two. Give the pre-treatment more time, and try a second wash if needed. Sunlight can also help lighten a faint mark on white cotton, since it is a gentle bleaching action. Keep the item in the sun only while it is wet, and only on fabrics that can handle it.
If a stain is still visible after several attempts, it may be permanent. That is more common on dyed or delicate baby clothes.
Keeping clothes looking good
A quick rinse soon after a spit-up keeps most stains from setting. Keep a bib or burp cloth nearby, and treat stains right away rather than leaving them until laundry day. Store clothes once they are fully clean and dry, since residue left in a pile can leave a yellowish mark over time.
For other clothing stains, the general approach is covered in how to remove stains from clothing. If you want to know whether heat matters for a particular stain, see does heat set stains in clothes.