Place the trivet into the instant pot. Place the ears of corn on top of the trivet making sure the lid will be able to close. You can add as many ears of corn as will fit.
Pour water or stock into the pot.
Pressure cook on high for 3 minutes, and quick release.
Serve immediately with butter, salt, and pepper, if desired.
Notes
Using stock adds more flavor. Use any flavor of stock you have on hand or what you like.
Frozen corn on the cob can be used in place of the fresh corn. Add 1-2 additional minutes to the cooking time.