Heat a skillet over medium heat and lightly grease with butter.
Crack the egg into the skillet and cook until set, flipping halfway through.
Season the egg with salt and pepper.
Butter one side of each slice of bread.
Place one slice of bread, buttered side down, on the skillet.
Layer with a slice of cheese, ham, the cooked egg, another slice of cheese, and the second slice of bread, buttered side up.
Cook until golden brown on one side, then flip and cook until the cheese is melted and both sides are crispy.
Remove from heat, slice in half, and serve warm.