First of all, you have to know that there are places on earth that still have not legalized the use of cannabis. Therefore, cultivating cannabis is also illegal there. The most important thing that you have to do before you buy or plant cannabis is to check whether you can legally do those things so as to avoid getting into trouble with the authorities.
Once you have verified that there is a legal cannabis law in place wherever you live, you can now proceed to the next step, which is to ...