Char broiled is always the best, but not always possible.
If pan fried, second best is to use a cast iron skillet, dry, sprinkled with coarse salt, heated very hot, to sear the hamburger and seal in juices.
When browned, turn. I tend to turn it fairly frequently after that -- more than most people. I like them an inch or so thick, and rare. Others of course vary. I like them minimalist, without buns best, with cracked pepper, no condiments, served with rice, and a vegetable.
On buns (ideally seeded roll or even pumpernickel) , I like the opposite -- Swiss cheese, catsup, mayo, onion, lettuce, tomato, etc. -- the works, or as they say in New Orleans, dressed.