I think this is much easier than people think; you use this when you're speaking in English. When you say "I wish I had done this", "He talks to me as if I was a fool", "I wish I lived there" - these are times when we used past tense verbs, but we're not talking about the past, we're talking about things that aren't real. Remember: not real + past tense = subjunctive And then we use the "they" past - for example: tener, ellos tuvieron and we get rid of the last two words - so tuvieron is now tuvier - and we conjugate like this: Yo tuviera Tu tuvieras El/ella/usted tuviera Nosotros tuvieramos Ellos/ellas/ustedes tuvieran Vosotros Tuvierais This you'll have to practice, but not very much because it's quite simple.
So with all this in mind, "I wish I had done this" becomes "deseo que hubiera hecho esto", "he talks to me as if I were a fool" becomes "me habla como si fuera un tonto" and "I wish I lived there" becomes "deseo que viviera allí".