The cannabis plant is a bit like an iceberg - what your eyes can see is just a fraction of a whole organism. What escapes your sight is actually the most important part of every plant - its root system. It is used for getting water and nutrition, and since proper nutrition is a key to a healthy plant and decent crops, there is no way of getting dense buds without well developed roots.
That is why it is a very big (though, unfortunately, quite common) mistake to think that you can grow marijuana in any substrate. Taking soil from the garden or recycling it after some dead plants often lead to miserable yields. If you choose to grow your cannabis in soil-based substrate, make sure it is a quality one, as cutting corners here will cost you dearly.
Other possibilities, alternative to soil, consist of already very popular coco, as well as more advanced systems such as hydroponics or aeroponics, where plant roots are being fed directly with a nutritional solution without the involvement of soil, that often host countless species of pests.
Just be sure that you make an informed decision - the kind of growing medium you will choose for your cannabis cultivation will determine the whole growing cycle, from the nutrition scheme to watering schedules.