Gym advice

So I’ve been doing a caloric deficit for a couple months now sort of and I’m deciding to go gym whilst doing it. The only problem is that sometimes I eat so much less and it makes me feel super dizzy just standing up so I’m worried this will effect me when I go to the gym... but I also can’t eat a big meal because it’s just going to put on weight I’ve already lost is what I feel. So I’m just stuck in this cycle so could anyone give advice or maybe some recommended meals / snacks to eat before the gym and also tell me if it’ll be safe for me to go because I’ve not went gym a single time since doing the low calorie intake ... thank you

Also if it makes it easier I am also overweight so I’m not gonna die but I’m just worried for my health and safety