If Tim had $20 to spend on 6 pens, and after buying them he had $8 left, that means that he spent 20 - 8 = $12 dollars on those 6 pens.
This means that to calculate the price of one pen, you just need to divide the money he spent ($12) by the number of pens he bought (6), and that is 12/6 = 2. Each pen cost him $2.