Spaghetti squash can be baked like any other winter squash. It can also be boiled whole for 20 to 30 minutes until the flesh is easily pierced with a fork. Cut in half, remove the seeds from the cavity inside, and scrape ribbons of flesh away from skin to serve. If baking, prick the skin with a fork to let steam escape. Leave in a 350° oven until it is soft, anywhere from 45 minutes to an hour and a half. When you take it from the oven, cut it in half immediately to keep it from cooking any more.
Overcooked spaghetti squash will lose its spaghetti-like texture. You can also cut it in half and place it cut side down in a baking dish with 2 inches of water. This method will cook the squash faster, in about 40 minutes. Store your squash out of direct light and extreme temperatures and it ought to last for a month or more.