The only way to prevent edema is to prevent the cause. Smoking is the main cause of chronic lung disease. Congestive heart failure most often is caused by coronary artery disease, high blood pressure or drinking too much alcohol. To avoid leg swelling on long trips, stand up and walk around often. Ideally, you should get up once an hour. If that's not possible, then exercise your feet and lower legs while sitting. This will help the veins move blood back toward the heart.