What is transaction log and how to use it?

Transaction log is a file that stores all modifications applied to database since the last back up. It is used on rollforward to recover data missing in back up after a restore operation. You can understand how it works with the following example: