Perfectly cooked pasta has slight resistance when bitten. It must never be mushy or stuck together, caused by over cooking.
An old trick to perfectly cooked pasta is to boil it al dente for a minute less than the box requires, and let it finish cooking in the sauce.
Reduce boiling time to half if you're using the pasta in a baked casserole.
Note that the pasta shape will determine cooking time, so consult the box. Angel hair cooks much quicker than fettucine. Small shells (conchiglie) cook quicker than bowties (farfalloni), one of the slowest cooking pastas.