How to Build Your Stamina for Swimming
To build your stamina for swimming, rotate between different strokes during your swimming sessions, like freestyle and butterfly, so you're working all of your muscle groups. You can also try swimming with closed fists, which will diminish the momentum created by your hands and force your arms to work harder. Additionally, do cross-training 3-4 times a week by swimming twice a week and including another exercise in between, such as long-distance running.
Set up a training routine. Set up a training schedule that allows you to practice and improve every day. Commit to swimming at a certain time each week so you get into a habit and your muscles won't weaken in-between lapses. Swim often, at least 2-3 times a week. Vary your swimming sessions with cross-training sessions in between so you have a chance to strengthen other muscles, too. Practice a variety of strokes. Don't just practice freestyle the entire time: incorporate many kinds of strokes into your sets. Different strokes work different muscles, and your endurance is only as strong as your weakest muscles. If you're new to swimming, practice a stroke for three or four laps (or until you've got the hang of it). Some great strokes to start with are: freestyle, breaststroke, backstroke, and and the butterfly stroke. Slowly increase the amount of time you spend on a certain stroke. Try to hold a certain stroke for 1-2 minutes longer each time until you build greater endurance. Try closed-fist swimming. When you want to focus on strength, make a fist with your hand instead of cupping it or holding it out flat while you swim. The momentum your hands make will diminish, and your arms will have to work more to stay afloat. This will strengthen your forearms and increase your workout threshold. Do closed-fist swimming at the beginning of your workout rather than the end. Swimming with fists is tiring, and you may be too fatigued if you save it for your last sets. Use a kickboard to practice. If you have a powerful kick, you'll greatly increase your swimming strength. Swim with your kickboard for a set number of laps so you can focus entirely on increasing leg endurance. Practice different kinds of kicks like butterfly kicks, back kicks, and side kicks. Plan to use a kickboard near the end of your workout, when your arms will be more tired and need rest. Practice swimming drills. Drills are practices that are designed to help you strengthen your technique. The better your stroke techniques, the faster you will be able to swim. Practice one or two drills at the beginning of your swim practice each day. The hand-drag drill increases hand-recovery speed. Swim a stroke as you normally would, but drag your hand through the water during the recovery phase. When you swim normally again, your hands will perform the drill much more swiftly. Try dolphin kicks for a swifter momentum. To practice dolphin kicks, kick your right and left leg at the same time, as if they were a dolphin fin. Vary the pace of your laps. To increase your energy and gain control over your speed, change your pace for every lap. Swim some laps at a leisurely pace, some at a moderate pace, and some at a racing level. For best results, don't just perform your laps from slowest to fastest. Mix up your laps with fast laps in-between slow or moderate ones so you have time to catch your breath. Work on your stroke body position. Poor swimming form can greatly limit your swimming speed due to excessive drag.  Study the correct position for each stroke and do your best to stay in correct form. Time yourself. Most swimming pools have a pace watch, a small instrument with a minute and second hand that divides time into 5 second increments, from 5-60 seconds or minutes. Try to perform a certain lap or drill within a specific time frame, shortening the time limit as your speed improves. If your swimming pool does not have a pace clock, consider buying a waterproof stopwatch or your own small pacer clock. Swim in a line. Part of strengthening your speed is increasing your efficiency. Try your best to keep your body in a straight line. Don't let you arms or legs cross their lines: for example, your left arm should never move into the right lane. Practice the single arm drill if you have trouble with swimming straight. Perform a stroke with just one arm per lap. Hold onto your kickboard with the other arm if you have trouble staying afloat. If you are performing a backstroke, use your eyes. Focus your sight on something straight ahead, like a diving board or a chair directly ahead of you. This will help you swim in a steady line. Plan to cross-train 3-4 days a week. Stamina requires balance, and cross-training will help you gain this. Swim 2-3 days a week, then exercise in other ways for the rest of the week. Choose exercise activities that you love. Tailor your exercises to activities that you enjoy so you will want to try harder. Increasing your stamina will be much easier if you love what you do. Long-distance running is an especially helpful cross-training sport for swimmers because of it builds endurance and cardiovascular health. Eat enough protein and carbohydrates on your training days. Carbs will provide energy to burn during practices, and protein will help you gain more muscle. Eat a meal at least 2-4 hours before swimming or a snack at least 30 minutes before to avoid cramps. Bring food with simple carbs (like pretzels, honey, or fruit) to eat directly after your workout. This will help you replenish your energy and raise your blood sugar. For protein, go for quality over quantity. Instead of protein shakes and red meat, go for a diet with lots of whole eggs, milk, fish, and soybeans. Try aerobic exercises. Aerobic training works your cardiovascular system and strengthens the muscles pumping blood to your heart. Plan on including 1-2 aerobic cross-training exercises a week. Examples of aerobic exercises include running, cycling, kickboxing, and hiking. Swimming is an aerobic exercise, so if you're short on aerobic cross-training one week, count your swim practices as aerobic days. Try anaerobic exercises. Anaerobic training involves intense workouts that improve strength and build your overall muscle mass. Having more muscle will help you during endurance swimming exercises, so try to include 1-2 anaerobic cross-training exercises a week. Examples of anaerobic exercises include squatting, sprinting, and high-intensity interval training (HIIT). For a balanced workout schedule, include a balance of aerobic and anaerobic cross-training days. Both have different benefits and can help you strengthen separate parts of the body. Add strength training to your weekly schedule. Weight training increases your muscle endurance and will allow you to use oxygen more efficiently when you swim. If you weight train, you will be able to to gradually build stamina in the muscles you focus on. Spend time using free weights, machines, or performing strength-training exercises once or twice a week. Rest to maintain balance. Work one day of rest into your schedule each week so your body has time to recover. If you train every day, your overall intensity will decrease over time due to exhaustion. Moderation is important in everything, even stamina training. On rest days, go on a walk, leisurely bike ride, or yoga class. Get plenty of rest the night before your workouts. Aim for between 7 and 8 hours of sleep a night. 
Set up a training routine. Practice a variety of strokes. Try closed-fist swimming. Use a kickboard to practice. Practice swimming drills. Vary the pace of your laps. Work on your stroke body position. Time yourself. Swim in a line. Plan to cross-train 3-4 days a week. Eat enough protein and carbohydrates on your training days. Try aerobic exercises. Try anaerobic exercises. Add strength training to your weekly schedule. Rest to maintain balance. 