Basketball can really make you work, so make sure you stretch and warm up before playing. Because of all of the quick moves and jumping, it can put a lot of wear and tear on your ankles, so protect them by wearing the right pair of shoes — medium or high tops do the best job of supporting your ankles. Protect those knees by learning how to cut, stop, and land a jump safely.
Be careful not to misuse basketball equipment. It's great if you've got the skills to put up a mean slam dunk, but hanging on the rim is dangerous and could cause you to get hurt. Also, make sure the court and sidelines are clear of any obstacles such as other basketballs or water bottles. If you're playing outside, make sure the baskets and sidelines are not too close to walls, fences, or bleachers and there are no holes on your court.
If you're a serious player, you may want to invest in a mouth guard to keep your teeth safe from flying elbows; knee and elbow pads so you don't get scraped up (especially if you're playing on an outdoor court); and sports glasses to protect your eyes.