I stretch after I run. When I had IT band tightness and pain in my knees I added IT band stretches like in this image except I place my hand much higher on the wall. The pain went away after a few sessions. Note that more advanced stretches may not be the best idea if your IT bands are super tight, you can easily injure yourself. If I don’t run and stretch at least once every 2 weeks, the pain will return.
Edit: image wasn’t working https://www.sparkpeople.com/assets/exercises/613.gif