Spread 1/2 tablespoon of the butter on 1 side of each slice of bread (3/4 teaspoon butter per slice).
Heat a large skillet over medium heat and add the buttered slices, buttered side down. Push the bread to the side of the pan and add the remaining 1/2 tablespoon butter to the other side. Add the ham and egg to the buttered side of the pan, and season the egg lightly with salt and pepper. Using a spatula, pierce the egg yolk so that it runs. Cook until the egg begins to firm and the ham browns, about 30 seconds.
Using the spatula, flip both the ham and the egg and cook for 30 seconds. Stack the ham and egg on 1 unbuttered side of the toast and top with the other slice, buttered side up.
Place the egg sandwich on a plate. If desired, top with grated cheese or other toppings, and serve immediately.