Different types of flashing are used. A couple moisture proof shown here, a flexible self adhesive & a flexible one that is good for using in corners.
Flashing material is layered so that any water running down the wall is directed out. Seams should never face up.