Go to the doctor and/or a physiotherapist and make sure you didn't tear a ligament, muscle, or tendon. An MRI, if needed, will tell you, and any other health care provider, where and what the problem is. Care can then be prescribed or recommended.
I'd say start with the Physiotherapist first, though, if you're able to get around ok outside of sports.
I tore my hamstring last summer playing softball. Rested it for two weeks then tried playing again and re-injured it (I did not know how serious the injury was). To make matters worse I moved furniture for my sister after re-injuring it which resulted in significant pain. I went to a massage therapist who did some amazing massaging as well as gave me a bandage to put around it. She advised it could take 4-6 weeks to fully heal if I did everything I needed to do. She also sent me to a physiotherapist for three sessions. After four weeks I was back to normal.
Hamstring pulls/tears need to be treated seriously otherwise you will keep re-injuring it and never get better. Go see a massage or physiotherapist to see if they can determine the extent of the injury. You may have a torn hamstring.