The imperfect subjunctive is a past subjunctive tense in Spanish, which is used to express extreme doubt or a very hypothetical idea.
To form the imperfect subjunctive you must first remember the 3rd person plural (they) conjugation of the verb in the preterite tense, and remove the -ron ending (ex. hablaron - habla.) Once you have the stem, you must add the appropriate ending:
Yo -ra / -se
Tu -ras / -ses
Él/ella -ra / -se
Nosotros -ramos / -semos
Vosotros -rais / -seis
Ellos/Ellas -ran / -sen
Although there are two possible endings, neither changes the meaning and both can be used for the same purpose. For example, Si tuviera/tuviese más tiempo, iría a la biblioteca. Most non-native speakers find the -ra endings easier to incude when speaking, so make sure to try both and choose whichever is more natural for you to say, but remember to learn both conjugations as they are both used.