My friend, the trumpeter Artie Barbato, introduced me to the pencil exercise. He advised the lip only approach. Here are a couple of videos describing this exercise, the first more detailed than the second:
Eric Blovin, advises trying the exercise and then making your own mind about how to use it after you have some experience with it. This is good advice for the second set of pencil exercises, as well. He likes placing the wooden end in the lips. I like to use the eraser end, as Artie taught me. You will find differing opinions as you explore advice on this and other matters of exercise.
Grant Golding has a simpler explanation, good for a review, and mentions some more advanced information.
Another use of the pencil involves alignment of the teeth. Artie did not get into this with me and I need to explore this some more, but it is worth considering. For now I would suggest getting into this after you have worked with the lip exercise for awhile.