Well, make sure your husbandry is correct. Are the temps 70-73F on the cool end and 80-83F on the hot end? Does you snake have hides that he can use on both sides? How old is the snake? Younger snakes naturally may be nippy, and it is just a matter of being patient. Definitely inspect your husbandry to make sure he has comfortable temps and can move from the hot hide to the cool side and has many good hides he can use so that he does not feel vulnerable. Also, is he hungry? are you feeding him an appropriate sized meal once a week? Sometimes they strike out of hunger (usually if it is hunger they hold on, if it is fear they strike and let go).
So, barring any environmental/husbandry issues, if it is simply a case of it hasn't been handled, all you really can do is handle it more often, letting it know that you won't place it back in the tank until it has calmed down.
USE GLOVES (soft cotton ones).
There is no shame in using gloves to pick up a frightened snake. You will want to make sure that when he strikes you do not flinch, and wearing gloves is the best way. You will want to scoop him up, do not come at him from above, as this will scare him more. This isn't aggression, it is simply him defending himself against something big and scary. So come at his body from the sides and scoop. Do not stop if he bites, just continue until you have picked him up, then hold him until he calms down, and once he calms down, put him back. Handle him for a few minutes every day (barring 48 hours after feeding). As he gets to know that you will not harm him, you can start taking off the gloves while you hold him, then eventually just scoop him up without gloves at all!
I have a young Okeetee that used to plot my death every night and always was striking me when I went to pick him up, and the glove method really worked. Now he doesn't get frightened and allows himself to be picked up and held.
I wish you the best of luck!