You must first create a routine. You should know what you will do each week and how long. This helps you plan and prevents procrastination.
The second thing is to ensure that you have plenty of variety in your workout. You don't want to become bored with exercise because then you won't stick with it.
Also, you need to keep track on your progress. It is crucial to track how much weight has been lost or gained.
It is easy to lose motivation after you have lost weight. However, it's much harder to stay motivated when you gain too much weight.
You should find a balance between weight gain and weight loss. You won't be able to exercise if your current weight is not comfortable.