Stars formation occurs in several steps. First a large scale phase during which the molecular cloud undergo fragmentation due to its self-gravity and turbulence. In the gravitationally unstable fragments the medium is optically thin causing all the energy generated by the collapse to escape freely. This is called the isothermal compression phase. When the cloud becomes optically thick to its own radiation, an hydrostatic core forms: the first Larson core. Follow an adiabatic accretion phase ending up ultimately in the dissociation of dihydrogen molecules. Part of the energy from the gravitational collapse is absorbed by the chemical process allowing for another quasi isothermal collapse to start until depletion of dihydrogen molecules. When the adiabatic phase is restored, the second Larson core (proto-star) is formed.Coding the non-ideal magnetohydrodynamics (MHD) solver in the adaptive mesh refinement code RAMSES has been the focus for the first part of the thesis. The precise study of the last steps (first and second Larson core) of star formation is the second part of the thesis. This study highlighted the impact of non-ideal MHD on the magnetic field repartition and the efficiency of the angular momentum transport.