Understanding how molecular clouds form in the interstellar medium and how they evolve to produce dense filaments and cores that eventually give birth to stars is an important unsolved problem in star formation. From a theoretical perspective, star formation is a challenging multi-scale problem that involves
complex nonlinear interactions of gravity, turbulence, magnetic fields, radiation and feedback processes. I shall describe a self-consistent computational framework for modeling molecular cloud formation in the multiphase ISM as a first step to generate realistic initial conditions for star formation. Our approach is based on self-organization in the turbulent ISM and, with only a few control parameters, our numerical experiments successfully reproduce the observed probability distributions of the molecular gas density, thermal pressure, magnetic field strength, as well as the core mass function. I shall briefly discuss the origin of Larson's scaling relations that naturally emerge in the model.