I am sorry that you hurt your wrist while playing basketball! The first step when dealing with wrist injury
is to make sure there is no major problem, such as a broken bone or torn ligament. Your doctor
will be able to help you determine this by performing an examination of the wrist and perhaps by ordering some X-rays if they seem necessary.
Assuming all of this checks out, then the treatment of a basic wrist sprain involves, first, rest and ice and elevation of the arm to reduce swelling. In addition to this, anti inflammatory medications like ibuprofen or naprosyn are very helpful. These should be taken regularly around the clock initially, as directed by your doctor, in order to get the maximal anti inflammatory effect.
With these methods, the pain and swelling should improve slowly. However, you will need to be realistic about how long this will take. Bad wrist sprains can take weeks to months to completely return to normal, although of course the worst of it should be over within the first week or so.
If you have further concerns about this problem, or if the pain and swelling are getting worse, talk to your primary care doctor