Place the sourdough slices on a clean surface and spread softened butter evenly on one side of each slice.
Flip one slice over so the unbuttered side faces up and spread a thin, even layer of pesto on it.
Sprinkle the mozzarella cheese evenly over the pesto, then add the second cheese on top.
Place the second slice of bread on top with the buttered side facing outward.
Heat a nonstick skillet over low to medium heat and carefully place the sandwich in the pan.
Cook the first side for about three to four minutes until golden brown, then gently flip and cook the other side until the cheese is fully melted and the bread is crisp.
Remove the sandwich from the pan and let it rest for one minute before slicing and serving.