Make sure to stir the spaghetti occasionally while cooking to prevent it from sticking together. You can also add a splash of olive oil to the cooked pasta and toss it lightly to prevent sticking.