Spray a small sized frying pan with cooking spray. Break your egg into the pan and stir around until yolk is mixed in with the white part. Put a dash of salt and pepper onto the egg and flip to the other side to cook. Set burner to low.
Spread your butter on the outside of both peices of bread. Put your ham on the side without butter and the cheese on top of the ham. Place the egg on top of the cheese and lay the other peice of bread on top butter side up. Place the sandwich in the pan to brown your peices of bread. Switch burner to medium now. When the bread is brown flip to the other side and wait until it is brown.