In a large pot or Dutch oven, melt butter over medium heat. Add diced onion and cook for 3-4 minutes until softened. Add garlic and cook for another minute.
Add the diced ham to the pot and cook for 2 minutes, stirring occasionally.
Pour in the chicken broth and milk. Add the Dijon mustard, salt, and pepper. Stir to combine and bring to a boil.
Add the pasta to the boiling liquid, stirring well. Reduce heat to medium and cook for 10-12 minutes, stirring frequently, until pasta is tender and most of the liquid is absorbed.
If using peas, stir them in during the last 2 minutes of cooking.
Remove from heat and immediately stir in the cheddar and mozzarella cheese. Keep stirring until the cheese is completely melted and the sauce is creamy.
Let stand for 2-3 minutes to thicken slightly before serving. The sauce will continue to thicken as it cools, so serve it nice and hot!