Need help with my 2 year old !😫

He recently started hitting and learnt it from daycare. He mostly does it when he's angry/frustrated but he also randomly does it when he's in a good mood too. I tell him no and it's not nice and he keeps doing it. What can I do to stop this behavior? Especially since his sister will be here in 7 weeks!Â