Baby hitting

My baby will hit my arm or kick me. Does he know what he’s doing or is he playing? What am I supposed to do about it?