Getting an autograph at a basketball or football game is very fun and could be the best part of any game for a fan. They are more likely to give you an autograph when they know that you know who they are, this way they know you will appreciate their signature.
Common courtesy is always important.
They like it when you treat them decently. In football there is more commotion and a lot more people to climb over and you are not on the same level as the players a lot of the time, so it will be a bit more difficult, so being prepared for a football game by following those tips up above. In basketball autographs are easy to get because the players are always around the bench and near the sidlines, so getting them to sign is a lot easier. The best way is obviously to have a front row seat and to get to the game early, but it is very difficult to get great seats. Try to make small talk while down there as teammates notice them talking to you and follow suit coming by to talk to them and you.