Lay out sourdough slices on a clean surface.
Spread softened butter on one side of each slice.
On the unbuttered side of 4 slices, spread 1 tablespoon pesto evenly.
Add sliced mozzarella over the pesto.
Place tomato slices if using, season with salt & pepper.
Close sandwiches with remaining bread, butter-side out.
Preheat skillet or griddle over medium heat.
Place sandwiches in skillet, cook 2–3 min until golden.
Flip carefully with wide spatula.
Cook 2–3 min more until cheese melts and bread crisps.
Remove from heat, let rest 30 sec.
Slice diagonally and serve immediately while gooey.