Not all of the memories given to Jonas are nightmarish or horrific. Some of them are really quite pleasant and can be put to good use, as happens in relation to the newchild Gabriel, Jonas' brother.
In Chapter 14 of The Giver, Gabriel, though doing very well during the daytime, struggles at night, and finds it hard to get to sleep. His father is understandably worried that the little boy might have to be released, and that's the last thing that he wants.
Jonas doesn't want this to happen, either. So he comes up with a plan. He gets Gabriel to nod off by giving him a calm, peaceful memory of sailing on a clear blue lake. This transference of a pleasant memory does the trick and Gabriel is, at long last, able to sleep peacefully at night.
Unfortunately, Jonas' efforts are not enough to prevent Gabriel from being chosen for releasement. So he makes the decision to leave the community and take his brother with him. On their journey, when the weather gets harsh, Jonas gives Gabriel some more pleasant memories to calm his fraught nerves and help him sleep better. This also makes it easier for them to avoid being spotted by the planes that have been sent out to search for them.