I have found that when I get the scratchy throat that typically leads to a cold I start a regimen of ibuprofen, pseudoephedrine, and fluticasone (allergy nasal spray). About half the time it avoids the cold altogether.
Does it actually work or am I fooling myself? I don't have hard data but I'm convinced it works for me.
Oh, and get some rest. I tend to get sick when I'm sleep deprived.
None of those meds do anything to prevent or end a cold, just treat symptoms. So you may be fooling yourself, or you may be treating your symptoms well enough that it feels like you avoided the cold altogether.