a. When I'm by myself, I like to take a rest on the sofa while reading a book.
*We can use the preposition while to introduce a longer background action or situation, which is/was going on when something else happens/happened.
b. I was scared to death once when I pulled over on a cliff of the Adap Mountain last fall.
*If a vehicle pulls over, it moves to the side of the road and stops, on the other hand passed by means went or moved past, so in this sentence it's more appropriate to use the expression pulled over.
***Hello, Kyonghee! Thank you for submitting your homework. I'm so glad that you were able to use the idiomatic expressions that we studied in a complete and purposeful sentence. Thank you, again. Carry on. :)