Turn on the Instant Pot, select "saute" and add some oil.
Add beef and cook until it's browned . Remove the beef and place it aside.
Add onion and cook on "saute" for 3 minutes. Add garlic and cook for 2 more minutes.
Place back in the beef, and add the crushed tomatoes.
Break spaghetti in half and place inside the Instant Pot over the tomatoes and beef. Pour over the stock and make sure the spaghetti are nicely covered.
Close the lid and cook on high pressure for 7 minutes.
Once done, do a quick pressure release (move the steam valve to "venting").
Open the lid and separate pasta by stirring for 1-2 minutes.
Serve and enjoy! Feel free to garnish with cheese and basil.