Hello...What you must first do is limit his access to toys. Only have very few out at a time that will not hurt anyone if thrown. If he does happen to throw a toy at you or just in general and laugh about it, grab his hand firmly and tell him that he needs to play nicely with his toys. Then you show your son how to play nicely with a toy and then have your son show you as well. Addi tonally, he needs to learn the difference between toys that can be thrown and those that cannot. Set aside some time for throwing balls in buckets, baskets, etc, and tell your son that it is now appropriate to throw the balls or beanbags or whatever. Reiterate that toys are never thrown at people or across the room.
When you discipline your child, the main goal is to teach him the appropriate behavior rather than to punish him. At your son's age, he will learn from modeling and examples. Be very patient as well as consistent with him It may take a while before he gets the hang of it.
I hope that this has helped. If you need more advice, just ask. Have a wonderful day. Thank you.