There are generally 2 schools of burger patties. Thin and cooked through, and thick and pink. It would help a lot if you explained exactly what you did in your attempt so that we have a baseline.
I’m assuming you went with a thick pink style since you say you burned your burger and got a rare center.
I’m also going to assume you added things to your burger other than meat and salt/pepper. It should be practically impossible to burn a burger patty on a skillet in the time it takes to cook.
A burger is a very simple thing. Start with some fatty ground beef - at least 80/20, form into patties of desired thickness and do not overhandle it. Just put in the least amount of time and pressure into it to form a patty until it just comes together. Salt + pepper goes only on the outside, right before it’s time to cook. Add more salt than you think you’ll need. If your patties are fat, give it a little dimple in the middle, and make sure the sides are vertical and don’t taper off. You want a hockey puck, not a UFO.
Get a pan hot and cook your patty on it. If you are cooking a thick patty, it’s going to need some time. The best way to get it to cook evenly is to flip it regularly. Poke into the patty if you need to in order to check for your desired doneness. I like mine somewhere between medium and medium rare, which probably will take about 7-8 minutes for a 6-8oz lb patty. For a tasty char all around make sure all parts of your patty are making contact with the pan, give it a little press if needed.
If it’s a thin patty, get the pan screaming hot and really press the patty down on it to get the most sear possible in the time you have to cook. 2-3 minutes per side is all you need if you’re working with 1/4lb or smaller patties. The goal here is to get the outside bits of your patty to be practically crunchy.
I hope that helps!