I've been managing people for years. I don't think there is any magic formula, but I can offer a few tips on the basis of my experience.
Firstly, don't be an arse! It sounds obvious, but so many managers treat their staff like shit. Be respectful. Understand that people have a life outside of work, and be as flexible as you possibly can to accommodate this. Be supportive. Listen to what people say, and don't assume that you know it all. Care about them as people, not just about the work they do.
Use your power/status sparingly. Don't pull rank or throw your weight around. Lead by example, not by decree. There are times when you will have to step up and make a decision, and there are times when you can let other people have a say. You need to know the difference. If you're the one making the decisions, do it quickly and unequivocally, on the basis of sound evidence, and own whatever you have decided. However, don't be afraid to admit when you're wrong. If you delegate decision-making to other people, then you need to have their backs. Help out with the little, menial tasks every now and then. Don't think you're above anyone else. Your role is more senior, but you are not superior. Everyone has value.
Give feedback. If people are doing a good job, tell them. Thank them for what they do, and make them feel appreciated, but do it genuinely. If people are not doing a good job, tell them that too, but in a constructive way to help them understand what you want them to do differently. Offer support/training if necessary. Don't be afraid to have difficult conversations and don't beat about the bush and hope that people will take the hint; issues fester if they aren't addressed. If people aren't doing what they are supposed to be doing, try to find out why. Be reasonable and supportive, but don't let them take the piss. If you have to deal with performance/disciplinary issues, address them as soon as possible and follow it up in writing. If the issue escalates, it will help you enormously to have a record.
When you delegate, don't micromanage people but do check in with them to ensure that everything is on track. If they bring problems, don't just chuck it back at them but do involve them in finding solutions. Empower people to take responsibility by letting them know that you will support what they do and ensuring that they have the necessary knowledge/skills/time/resources to deliver. Ensure that you give them the credit for everything that goes well, and remember that ultimately, it's your responsibility when things don't go well. Be mindful of staff workloads, and encourage them to maintain a good work-life balance. Look after your own work-life balance too - your behaviour contributes to the overall culture of the organisation.
Be fair and consistent. Don't play favourites. Don't share people's personal information. Your job is not to be liked, so don't make decisions on the basis of what will make you popular. Having said that, people will usually like and respect you if you work with compassion and integrity.
Remember that people are human. They will fuck up sometimes. So will you. You need to create an environment where people trust you enough to tell you when something has gone wrong. Don't blame people for mistakes, focus instead on how to make things better in the future. Encourage people to share their own ideas about how to improve stuff. Remember that the team can achieve much more together than you can on your own. Give people opportunities to work together and try to play to their strengths.
Remember that a happy team is more productive than a miserable one. Your job is to make it possible for everyone else to do their best work.