Multi-wavelength astronomical surveys promise to provide unprecedented data on dark matter halos from galactic to cluster scales in the coming decade. One of the new frontiers lies in studies of intracluster medium (ICM) and circumgalactic medium (CGM) for cosmology and galaxy formation. In this work, we will combine cosmological and idealized simulations to study the non-linear growth of structures and the effects of small scale astrophysics in the realistic cosmological settings. Specifically, we will investigate the connection between the dark matter halos and the cosmic web structures, focusing on the outer boundaries of dark matter and gaseous halos around cluster-size dark matter halos and the filamentary cold gas accretion feeding highredshift galaxies. We show that the edge of the phase space structure and accretion shock radii denote the outer boundaries of the halos and have the potential to advance cluster cosmology. We also investigate the roles of hydrodynamic and gravitational instabilities on the survival of cold gas streams feeding high-redshift galaxies. My research highlights the importance of understanding the growth of dark matter halos and their interactions with the cosmic web structures for advancing cosmology and astrophysics in the era of multi-wavelength astronomical surveys.