It's a formula based on weight / height / age / and activity level but it's not exactly accurate.
That page I sent you to gives you an idea and even a breakdown of maintaining / cutting / bulking.
Here's mine.
View attachment 192276
View attachment 192275
Now introduce the exogenous 'supplements' into the mix and one could reduce caloric intake while maintaining and growing muscle at the same time. At least keep muscle loss to a standoff. The quality of foods you eat.
What kind of carbs?
What kinds of proteins? (Fast digesting / Slow digesting) and when?
Fats. Bacon. The only kind of fat. j/k. No, really. Bacon is sooooo bad / good.
Cut calories 500 daily and you will lose weight without killing yourself in the gym.
Now add in better programming, and best timing of when you eat what to maximize and you get you some muscles and over time this amazing thing called a metabolic rate. I'm 55. I don't remember what that is, and I'm trying to remind my body.
Don't go into analysis paralysis, but do become a student of foods, and there are some real foodie rocket scientists on here who know their way around the calories.
Maybe explore IF (Intermittent Fasting)