Are there any hard and fast rules for the usage of these words? 'I hate anything that contains raisins.' 'I hate anything which contains raisins.' I honestly have no idea which is the correct one.
You'd use "that" for that one. If removing the words after that/which would change the meaning of the sentence, use "that". If it wouldn't change the meaning, use "which". "I hate porridge that contains raisins" - suggests that you might be fine with other kinds of porridge. "I hate porridge, which makes it hard to find good breakfast food." - says that you hate porridge and adds some extra information that doesn't really affect your porridge hatred. Or: I hate anything that contains raisins - really doesn't like raisins I hate everything, which includes raisins - really doesn't like anything, and by the way, raisins are included.
I had a big argument about this once with the tech writing person who was assigned to review my documentation, back when companies did that sort of thing rather than being grateful to have any documentation at all, however incoherent. She was right about "that" and "which", I now accept. She was wrong about our use of "ship" in a software context. OK, that wasn't your question. My understanding is that "which" has an implication of making a distinction between more than one candidate: I hate anything that contains raisins. I'll take the trail mix which does not contain raisins. (Leaving the implication of, or perhaps actually stating, "instead of the one which does.") But this is not one of the things that I intuitively understand. Oh, hey! That should be "This is not one of the things which I intuitively understand," shouldn't it? Edited to add: OK, I just Googled, and it appears that the entire relevant part of my post is wrong. Perhaps a neat backwards kind of wrong, or perhaps a tangled kind of wrong. And maybe I'm wrong in my statement that the tech writer was right, though if she were here she'd probably say, "NO! That is NOT what I told you!" So I'm going to add strikethrough unless and until I stop being confused.
I saw this said on a grammar site, and I just can't get my head around it. If I remove the words after that/which in those examples I'm left with this: 'I hate anything that.' 'I hate anything which.' So what's that supposed to tell me??
Leave out the that/which as well. So "I hate anything" doesn't really make sense on its own, so that's how you know you need the bit about raisins and that's why you'd use "that". But if the sentence was "I hate everything" it would be fine on its own, so if you were going to add another detail you'd use "which", because it's not essential for the sentence to make sense.