We use the pronouns 前者 and 后者 when referring to something that has been mentioned before.
The pronoun 前者 refers to what is said first, while the pronoun 后者 refers to what is said next.
Examples
学汉语和学英语都不容易,前者难在发音和汉字,后者难在语法
Learning Chinese and English is not easy. The first one is difficult because of pronunciation and writing characters, and the second one is difficult because of grammar