I was playing basketball, and when I jumped I landed on the side of my foot. I heard a crack and hurt my ankle. Now it's swollen and hurts if I moveit?

Sprain vs break. It sounds like you may have sprained or fractured your ankle. You should see your doc for an evaluation, which might include x-rays. Unless surgery in indicated, the treatment will include rest, ice, compression and elevation.
Ice & X ray. Immediate icing and stay off that ankle. Need to go to er to get c ray and possible cast or splint or other.