Every behavior has a purpose or function whether it is to get something, avoid something, or just to make yourself happy. Think about it this way: When it is cold outside, you put on a coat before leaving the house. Why? Well to prevent yourself from getting cold, of course! The function of putting on a coat is to avoid the cold and stay WARM.
Let’s take the coat example again. When you put on a coat before going out into a cold, blustery winter day, you stay warm. You really enjoy staying warm in your coat, so the next time you go out on a cold day you grab your coat before you head outside. Voila! Reinforcement!