Many active people, particularly runners and cyclists, can experience iliotibial band syndrome, which is caused by overuse and repetitive friction between the ITB and the outside of the femur bone as the knee continuously flexes and extends. This causes pain and inflammation usually just above the knee joint.
To help prevent ITB syndrome, it is important not to over use or stress the ITB. For example, hill running, especially downhill running, puts excessive strain on the ITB as it works hard to stabilise the knee, and running on roads with distinct 'banking' disrupts good gait and posture, which again contributes to causing friction. Also look to maintain your flexibility, but not just in your legs. Pay attention to stretching the muscles in your legs, hips, and lower back, and safely building strength in all of these muscles too.
If you do experience ITB pain, then rest, ice, compression and elevation (RICE) are key to healing, as well as reassessing your training regime. Gentle stretching and massage have been proven to be beneficial to recovery. You can self massage the area using foam rollers, and new research shows that regular easy rolling of the ITB, instead of intense hard pressure, can be effective in easing the discomfort and aiding healing. Or, see a professional sports massage therapist if you don't have a roller, as they can work effectively around the whole leg and hip area.
Whether or not you're sporty, it is also wise to consider whether biomechanic imbalances and posture issues, which can make the ITB tight, or tight muscles themselves, play a part in your ITB pain. A clinical therapist trained in posture assessment may be able to evaluate whether you have a contributing cause. And shoe orthotics can also assist the problem.