Preheat an oven to 350 degrees F (175 degrees C). Coat a baking sheet with cooking spray, and place squash halves cut-side down on the sheet. Bake until squash is tender but still crunchy, about 40 minutes. Set aside to cool.
Once cool enough to handle, shred squash flesh from rind using a fork. Set aside.
Melt butter in a skillet over medium heat. Cook onion and garlic in butter until soft. Add squash to the skillet, and cook until hot. Season with salt and pepper.