Lifeline is an extra yarn you put in your stitches (like a soft knitting needle). That way if you need to frog you have a stopping point where you know your work was good. You can then pick up the stitches from the lifeline without any problems and you won’t lose stitches.
I recommend you to put a lifeline in on every 5 to 10 rows or every purl row if you’re a beginner. For more complicated patterns I put the lifeline in after every pattern repeat (if possible).
What to use for a lifeline? I use a cotton thread in contrasting color and will insert it with the sewing needle. Some people buy something from the yarn shop, some people use dental floss (but this may break your yarn if you’re not careful).
Using a lifeline is now part of my knitting and they have saved me from ripping out my hair more than once.
Stitch markers and lifelines are a MUST especially if you are just learning to knit (stitch markers will help you keep count of pattern/repeats).