I have had a sprained ankle for three weeks and its still mildly swollen and causes me some pain some pain what should I do?

PT. You should get set up with physical therapy to improve peroneal muscle strength and balance sense (proprioception). See your primary care doctor or orthopaedic surgeon to get examined and a prescription for physical therapy. A compression stocking will help swelling resolution. At three weeks out you may not need any immobilization.
It may take months. Ankle/foot sprains are known to last longer than other parts of body because of their weight-bearing nature on every step you take. Mild sprain may last couple of wks, but severe ones may take months, good shoes/cushions, ankle support/aircast/braces may help. Elevate when u can. Motrin/aleve may easy pain/inflammation. If persistent/more severe, consult doc. My ankle sprain x5 months-still sore.