Calories in, calories out dictates almost everything when it comes to weight loss. However, I do support minimizing insulin secretion in the evening. So if you want to have an evening snack to improve sleep it's fine but try not to eat simple carbohydrates right before bed. "No white at night" is a easy way to remember it. No white sugar, bread, rice, pasta, etc but small amount of whole grains are fine. Even better is a little lean protein to help rebuild your muscles while you sleep.