The word former specifies the 1st of two items which were spoken/written.
I made a pie and a cake today. I prefer the former. (This means that I prefer the first one – the pie.)
The word latter specifies the 2nd of two items which were spoken/written.
Some people like to travel by car or by plane. I prefer the latter. (This means that I prefer the second one – travelling by plane.)