Set the Instant Pot to sauté mode and add the olive oil. Sauté the garlic and (optional) onion for 1-2 minutes, just to release flavors. Add the orzo and sauté for 2-3 minutes, making sure to stir so the pasta doesn’t start to burn in spots.
Hit cancel on the pressure cooker, and then slowly add the chicken stock or water on top of the orzo. Add a couple of pinches of salt.
Do NOT stir the pasta before closing the lid. Stirring the pasta in the broth/water may release too much starch, making the orzo come out sticky and gluey.
Secure the lid, making sure the knob is set to the sealing position, and cook on manual mode high pressure for 2 minutes. Note that it will take approximately 3 minutes for the pressure to build up before the 2 minute timer starts.
Cook for 2 minutes. Once cooking is completed, place a towel over the knob, and do a quick manual pressure release.
When the remaining pressure is released, open the instant pot lid and give the orzo a stir, making sure to loosen any stuck pasta on the bottom of the pot.
Close the lid for 5-8 minutes, allowing the orzo to cook in the residual heat and absorb the remaining liquid. After 5-8 minutes, remove the lid and give it another stir. The orzo should be creamy and cooked al dente.
Serve immediately, or refrigerate to make into a cold pasta salad. Note that there may be a little residual liquid, but it will fully absorb while the pasta continues to cool.