1sweed is a little misinformed. Cannabis is non-addictive, unlike opioid pain meds, has virtually no dangerous side effects, and is impossible to overdose on. I tried using it as a medicine on a doctor's recommendation for insomnia in the late 90's. My findings are that smoking is not so great to help one fall asleep, consuming is way better for that. Smoking does help immensely to increase appetite for those of us nauseated by food, as well as take care of nausea after eating. Cannabis is an amazing stress reliever, which for those of us with FM does bring pain relief. Overall, I like that it helps with many of my ailments while not making me worse from side effects. Additionally, the medical community has found that cannabis is not physiologically addicting, like opioids, most sleep medications, or caffeine.
For consumption, I recommend making cannabis butter. There are many videos and forums that can go into more detail if you need, but the concept is easy. First, boil the ground up leaves, stems, and/or flowers for 3-8 hours (opinions vary, I do it for about 6 hours and have good results) with butter. The cannabinoids are bound in oil and you want to draw out the oil from the plant material and have it bind to the fat in the butter. Next, strain water into a large enough bowl using cheesecloth in strainer, pour clean hot water over material to rinse out butter/oil, squeeze cheesecloth to get water/oil/butter out. (My wife like to make me hot cocoa by tying off the cheesecloth and steeping in warm milk and adding melted chocolate chips, never slept better) Set the bowl of water/butter in the fridge for a few hours, the butter rises and solidifies. You can then carefully pull the butter off and store in a sealed container in the fridge. The "canna-butter" can be substituted in any recipe calling for butter or vegetable oil. Personally, I make brownies from mix and use the butter instead of vegetable oil. Cookies are also convenient. (Please treat as any medicine and keep out of reach of children!) If your state has dispensaries, you may be able to buy ready-to-eat products.
It sounds like you are new to cannabis, it will take some time to determine the dosage that best suits your need. Keep in mind that it takes about an hour or so for effects to kick in, and the effects will last many hours (about 8 hours for me). If you take a little too much, don't worry (overdose levels are way too high to worry about), just stay calm and realize the effects will pass. Start off small and remember to wait about 2 hours before deciding to take more if you aren't feeling it. The effects can creep up on you and can be overwhelming if one ingests more than one needs.
Do your research first, as with any new medicine. See if the risks are worth the benefits for you. Personally, I have found cannabis to be the safest drug to use for many of my ailments (insomnia, lack of appetite, nausea from pain and food, stress, anxiety).
I hope this info helps. Good luck and be well.