There are many instances for using the subjunctive. For example, it is used when expressing doubt, when someone recommends you do something/tells you to do something and there are also certain phrases which require the subjunctive to be used after them such as 'como si'. If you were to say 'If I were rich, I would buy a car' in Spanish, the first clause would require the use of the subjunctive. The sentence would be said like this: 'si fuera rico/a, compraría un coche'. 'Fuera' is the imperfect subjunctive of the 1st person singular of 'ser'.