Obey the the most important rule and use the largest pot you own for cooking pasta. If you use a small pot and too little water, you will get a starchy mess and your pasta might stick to each other.
Always add a generous amount of sea or Kosher salt to your pasta water. It helps water boil faster and adds flavor to the pasta.
When cooking any pasta--fresh or dry--make certain the water is in a rapid boil before adding pasta.
For spaghetti, fan the pasta out and lean them against the side of the pot--spacing the pieces away from each other. Then, with a spoon or tongs, press the pasta down gently as the water starts to soften it. Give a good stir after all is submerged.
After your pasta is placed in boiling water, stir strongly for 20-30 seconds, getting a vortex going. This will prevent sticking.
If you like to break spaghetti in half, grab your batch of halved spaghetti around the middle, then let the spaghetti fall into the center of your pot as you turn your hand, allowing them to fall separately. This will fan out the pasta like spokes of a wheel, preventing it from sticking to each other in those first crucial seconds. As before, stir into a vortex.
NEVER add oil to the pasta water... no matter what your Nonna told you. Pasta should absorb its sauce to enhance the flavor of the dish. Oil will prevent that from happening.
Bring your water back up to a boil quickly by covering the pot with the lid slightly ajar. You can place a wooden spoon under one side of the lid to prevent boil-over.
Alternate: To keep the pasta from boiling over while cooking, place a wooden spoon across the top of your pot. When the bubbles touch the spoon's handle, the boiling settles down. Uncovered pots do take longer to reach a boil.
Do NOT rinse pasta after draining--ever. This would wash off the starchy surface which helps a sauce stick and become absorbed by the pasta.
When you're planning a baked pasta recipe in a casserole, try this trick: Place the pasta in a bowl of well-salted water, swirl it around the bowl a few times with your hands, then let it rest while you cook the sauce or prep other ingredients. The pasta will absorb the perfect amount of water by the time you are ready to put your casserole together. Drain any water left after about 30 minutes of soaking. This hack can also trim at least 10 minutes from your normal bake time.