Massive stars, at least ∼ 10 times more massive than the Sun, have two key properties that make them the main drivers of evolution of star clusters, galaxies, and the Universe as a whole. On the one hand, the outer layers of massive stars are so hot that they produce most of the ionizing ultraviolet radiation of galaxies; in fact, the first massive stars helped to re-ionize the Universe after its Dark Ages. Another important property of massive stars are the strong stellar winds and outflows they produce. This mass loss, and finally the explosion of a massive star as a supernova or a gamma-ray burst, provide a significant input of mechanical and radiative energy into the interstellar space. These two properties together make massive stars one of the most important cosmic engines: they trigger the star formation and enrich the interstellar medium with heavy elements, that ultimately leads to formation of Earth-like rocky planets and the development of complex life. The study of massive star winds is thus a truly multidisciplinary field and has a wide impact on different areas of astronomy.In recent years observational and theoretical evidences have been growing that these winds are not smooth and homogeneous as previously assumed, but rather populated by dense "clumps". The presence of these structures dramatically affects the mass loss rates derived from the study of stellar winds. Clump properties in isolated stars are nowadays inferred mostly through indirect methods (i.e., spectroscopic observations of line profiles in various wavelength regimes, and their analysis based on tailored, inhomogeneous wind models). The limited characterization of the clump physical properties (mass, size) obtained so far have led to large uncertainties in the mass loss rates from massive stars. Such uncertainties limit our understanding of the role of massive star winds in galactic and cosmic evolution.Supergiant high mass X-ray binaries (SgXBs) are among the brightest X-ray sources in the sky. A large number of them consist of a neutron star accreting from the wind of a massive companion and producing a powerful X-ray source. The characteristics of the stellar wind together with the complex interactions between the compact object and the donor star determine the observed X-ray output from all these systems. Consequently, the use of SgXBs for studies of massive stars is only possible when the physics of the stellar winds, the compact objects, and accretion mechanisms are combined together and confronted with observations. This detailed review summarises the current knowledge on the theory and observations of winds from massive stars, as well as on observations and accretion processes in wind-fed high mass X-ray binaries. The aim is to combine in the near future all available theoretical Unified view of of inhomogeneous stellar winds in supergiant stars and HXMB 3 diagnostics and observational measurements to achieve a unified picture of massive star winds in isolated objects and in binary systems.