This is totally normal, and well done for admitting your stress.
An aggressive weight loss plan can negatively affect your mood further and is certainly not advised for your mental as well as physical health.
By attending the gym, you will help lose some weight but don't just run on the treadmill for an hour this is unproductive and may affect your motivation,. try weights but maybe doing more LIIT like walking or cycling to the gym or your place of education or work, this time outdoors will also aid your mood.
Diet wise a calorie deficit is a great way to start but make sure not to eat too little because this can actually prevent you from losing weight, so try and eat high protein, low calorie, balanced meals making sure to include enough carbs so that you are not feeling drained and weak.
I personally do not recommend intermittent fasting, but that's due to my own experience, however it may work better for others.
Remember everyone is different and need different things to obtain their goals.
Don't give up and good luck for your exam and congratulations on your engagement.