Mark Spitz, Ian Thorpe, Dawn Fraser, Michael Phelps... all fantastic swimmers and legends in their own right. If you aspire to get even close to them, you must focus on one main aspect of swimming - speed. You should constantly be looking at improving your lap timing without compromising on stamina.
One thing you should keep in mind is that maintaining your stamina or your energy level is just as important as swimming faster is. A balanced swimming workout should include a healthy mix of speed drills as well as endurance training. For example, if you swim six days a week, you should devote at least three days to endurance training. Speed drills should be done twice or at the most, thrice a week. This will ensure overall development and progress as far as your swimming skills are concerned. Proper swimming technique (building bigger muscles won't help, if you don't improve your swim stroke mechanics), training time (enough time and practice), and workout structure (for strong, flexible muscles) can help you increase your speed while swimming.
✦ Swimsuit: Purchase the right kind of swimsuit. You should ideally be on the lookout for a swimsuit, which will minimize water drag, and will assist in propelling you forward through the water. A lycra-based bodysuit will more or less suffice your need for an appropriate swimsuit. Poor-fitting goggles can also slow you down. So, choose your accessories properly.
✦ Minimal Body Fat: You must look towards shedding all the excess amount of fat from your body. Do not confuse fat with weight. The idea is to lose fat and build muscle. If, in the process, you end up gaining a few pounds, that's absolutely fine. The increase in weight is due to muscle gain. More muscle provides you with more muscular strength (duh!) using which, you can propel your body more powerfully through the water, thereby gaining speed.
✦ Stroke Length: Many people think that increasing the number and the speed of their strokes will help in improving their swimming speed. Nothing could be further from the truth. What you should keep in mind is that you need to utilize the length of your body and your stroke to the fullest. Long and steady strokes are more purposeful, effective, and efficient as compared to a continuous flurry of strokes. It's all about simple mathematics. If one properly performed stroke takes you forward by a distance of say three meters, then it would take you around sixteen to seventeen strokes to complete a fifty meter lap. However, on the other hand, if you indulge in a rapid flurry of strokes without letting each individual stroke take you ahead by its fully achievable distance, then you will invariably find yourself requiring over twenty strokes to cover the same distance.
✦ Technique Improvement: Paying attention to your swimming technique is very important for the sake of both endurance as well as speed. You should concentrate on your hand and leg positions as well as on the curvature of your body. If the body is properly balanced, you will be able to kick harder. Your body should neither be totally above the water surface, nor should it be too deep inside the water. Swimming deep will only increase the amount of water resistance, and will inevitably slow you down. For the freestyle stroke, you should maintain a position that is as horizontal as it can possibly be.
✦ Basic Rules: Your arms are responsible for about 90% of your speed, while your leg movements determine only 10% of your speed. So clean and correct strokes can help improve your speed. You should use your sides in a correct way. Roll from side to side as you move forward. Strong back and shoulder muscles can help you increase your speed. And don't clamp your fingers together. Spread your fingers slightly, when swimming.
✦ Diet: What you eat also affects how fast you swim. Eliminate all junk food and fatty foods which add nothing but unwanted fat to your body. Instead, opt for protein-rich foods such as poultry, fish, eggs, soya, etc. These aid the process of muscle building, which subsequently aids the process of faster swimming. A good amount of carbohydrates is also important as carbs provide you with much-needed energy for your swim workouts.
This was all about how to swim like a pro. In addition to the tips mentioned above, you should also seek the help of a professional swim trainer. It will definitely help you to become a better and a faster swimmer.