Select the sauté mode on the pressure cooker for medium heat. When it has reached temperature, add garlic, onions, and 2 tablespoons butter. Cook for a few minutes, stirring frequently.
Add ham and cook for a few minutes, stirring frequently. Turn off the sauté mode. Scrape up any brown bits stuck to the bottom of the pot.
Add green beans, 1/4 cup water, salt, and pepper. Stir together.
Cook at high pressure for 4 minutes. As soon as it’s done, manually release pressure by carefully turning the release knob to its venting position.
Uncover and stir. Thoroughly strain to remove the liquid. Add additional salt and pepper to taste. Serve while hot.