The most effective cat training is best done early. If you bring home an older cat, start training as soon as possible and hope they didn't scratch much in their previous home. Kitten training is usually easier because kittens have not had much chance to form bad habits. When your cat is still young, he is more open and responsive to training.
Let me give you some advice that can potentially stop your cat from ever biting you again. Picture this: You're relaxing on the couch, deeply involved in your favorite book or TV show, when your cat strolls across the top of the couch and rubs against you, wanting attention. You give in (like always), let your cat get comfy in your warm lap and proceed to pet, massage and otherwise shower your spoiled cat with affection.
Soon, your cat's tail begins to wag. Slowly at first, and then faster and more enthusiastically. You think "This is great! My cat must be really happy!"