I cook pasta rarely, because I try to limit the amount of starch I eat.
I cook pasta like I braze (or rather like I try to braze). Get it hot, get it done, and get out. Don't cook it any longer than necessary.
Salt the water before you even start it boiling. Use plenty of coarse salt. Helps it boil faster. [Maybe. See below.]
Taste the pasta while it's cooking. I do this about three times. Ignore the clock and timer. Take into account that you want it have a little bite when you eat it, and that it will keep cooking a little after you drain it. You want pasta to be about medium-rare when you eat it, so cook it to rare.
Drain the pasta well when you're done, and do it quickly. You want all that hot water out of there so it cools down and stops cooking ASAP. Shaking the colander can help.
Coat the pasta with a little olive oil when it's still in the colander. Keeps it from sticking. Use a light olive oil of the finest quality you can get. Imported from Spain or Italy and Extra virgin for sure. First cold press if possible.
Use the right materials. Good, fresh pasta is great, though usually too rich for my budget. Good olive oil is relatively cheap, and necessary for so many other things. Salt in the water is essential. Likewise a good pot of the right size, depending on how much is being cooked. And plenty of water.
Bad pasta was cooked in too small a pan, with too little water, for too long, then sat in the waer for a few minutes before it was drained, and not coated in oil afterward. It tastes so bad. It tastes like the worst airline food on the worst airline.