Along with fats and proteins, carbohydrates are one of the three macronutrients in our diet and their main function is to provide the body with energy. They appear in many different forms, such as sugars and dietary fiber, and in many different foods, such as whole grains, fruits, and vegetables.