How to stop a child from head butting?

I’m a FTM to a 13-month-old who loves to slap and headbutt; however, if we tell him no, he’ll start hurting himself like slapping his own face headbutting the house; I get scared he might actually hurt himself if I try to get him to stop he’ll have a full-on screaming, crying fit where he’ll hit me, dad or whoever is around any advice on how I can handle these situations is greatly appreciated as I feel like I might lose my mind