How to swing less? And hit lower balls?

I am a beginner in tennis. I have gotten a lot of comments saying that I swing my racket back too much. I do find that it’s easier to generate power that way, but sometimes it makes me hit the balls too late and moonballing. Been trying to fix this but I forget every time, it’s been etched into my muscle memory.

Anyone has tips on how to fix my issue or video references I can learn from? Would love to get more advice if you have :)