The Dichotomy Between Structure And Randomness And Applications To Combinatorial Number Theory