>>2230873Anon your gonna have to do some research, like actual research here.
Ideally you want to approach it like building yourself a basement and take steps accordingly. You want it to be high enough that it doesn't suffer from water saturation, you will need to treat the walls for moisture permeation, non-porous material and create ways to keep it dry such as a false floor above a drainage point with a gravel floor. Even then you will need ventilation in order to keep away moisture build up from inside and allow for good airflow. All wood will need to be treated for rot prevention and stained. Also if it's meant to be used in winter, you will need to figure out a system for venting through a chimney system.
Even in the underground house movement that was popular in the 70s a lot of the designs were partial underground houses since it offers weather protection and solves most ventilation issues.
As for those pointing out the burying of a shipping container, this is literally a meme tier answer without actually going into the same essential problems above, it will need reinforcing, it is only strong at the junction points/corners of the crate and will cave in, bow, rust without reinforcements and proper care taken to prevent water seepage.