We have a lot of information on our site already about using cannabis products for pain and sleep. I suggest you start with these two searches, and then if you have further specific questions, feel free to post them:
Many people are going to recommend you indica for pain and sleep. However, I would go about it a little differently. For sleep I would use an indica with a kava extract and some CBD oil. If that doesn’t work you could add passionflower and valerian root. And I’m sorry, if that doesn’t work… nothing natural short of opium will.
For pain, you really need to identify the root cause of the pain in order to get a true sense of what’s really going to work. There are too many different types of pain and some will respond better to anti-inflammation, others need endorphins to kick in while still others may be much more neurological and CBD can really help with that. But take it easy. Generally, the best thing for pain is rest and some MJ can really aid in that department. I know it’s not what someone also suffering from insomnia wants to hear but the plus side is… focus on the insomnia first and the pain by rights, should improve.