Heat the butter in a skillet over medium heat. Add the finely chopped onion and garlic. Cook until translucent and fragrant.
Add the ham
Stir in the diced ham and sauté for about 2 minutes to enhance its flavor.
Make the roux
Add the flour to the pan and mix until you get a smooth, lightly golden mixture.
Add the milk
Gradually pour in the cold milk while whisking continuously to prevent lumps. Keep cooking until the béchamel thickens and coats the back of a spoon.
Season and chill
Season with salt and pepper to taste. Spread the mixture onto a baking sheet lined with parchment paper. Let it cool at room temperature, then refrigerate for at least 25 minutes.
Shape the croquettes
Using a tablespoon, scoop portions of the mixture and shape them into balls or logs. Roll them in flour, dip in beaten egg, then coat with breadcrumbs.
Fry the croquettes
In a saucepan or deep fryer, heat the oil to 350°F (180°C). Fry the croquettes in batches until golden brown. Drain on paper towels.
Serve hot
Serve immediately with a fresh salad or a lightly tangy sauce to balance the flavors.