Bring a large pot of salted water to a boil, then add the pasta add cook until it is just a bit shy of al dente. The pasta will finish cooking in the sauce
Meanwhile, melt the butter in a large skillet over medium heat. Add the onions and cook for about 3 to 4 minutes. Then add the garlic and cook until it becomes fragrant, about 1 minute
Add the ham and mix well to combine. Add the heavy cream and grated Parmesan and stir to combine
Drain the pasta and add to the skillet with the cream sauce. Stir to combine and let cook for 3 to 5 minutes
Add salt and pepper to taste, then let sit for 5 minutes so the sauce can thicken slightly before serving