Your best approach is to use a calorie intake/metabolic rate calculator like
https://www.iifym.com/iifym-calculator/
There many out there but I trust this one. Though even with good calculators this is still just an estimate. Often time I "thought" I was cutting based on projections from iifym but with my slightly higher metabolism I had to cut more than what was recommended.
It took me a couple years to really hone in on the right numbers when it came to bulking and cutting. It may not take you as long but certainly there will be some trial and error involved. Just be patient and don't change things every couple of days when you don't see results. Stick to it for a couple week or a month then re-evaluate and adjust.
You build muscle when you bulk, you lose fat when you cut. It's really not sustainable to build muscle and cut fat simultaneously. Be clear about your goals. I'd recommend cutting to where you want to be bodyfat wise, then start a bulk.
There's a lot of great answers on this site already that cover in more detail. Good luck! Also if you're new to fitness articles and blogs be prepared to hear a lot of conflicting and contradictory advice. Don't listen to anybody at the gym ;-)
Mike Matthews is a good author if you're just getting started. He has a good online and social media presence.