How to differentiate between a viral or bacterial infection?

I have a sore throat. Is it viral or bacterial?