Hitting players with your shoulder or body is legal in hockey. Some players cross the line and get penalties for those kinds of hits, but most of the time they are okay. Players will get into trouble when they use the shaft of their stick to make contact with an opposing player.
The NHL rulebook states that cross-checking is "the action of using the shaft of the stick between the two hands to forcefully check an opponent."
A minor penalty is usually the most common severity, but there are some occasions where a player gets a major or match penalty depenidng on the force of the infraction and whether an injury occured.
There are plenty penalties in the rulebook that happen due to a player using their stick as a weapon. The strick is the most lethal weapon that a player can use, which is why we've seen some bad incidents with players getting cross-checked to the face.
The video above ended with Morgan Reilly getting a match penalty and a five-game suspension. However, the video below is an example of a vicious cross-check that didn't even result in a penalty. The video shows the problem that people have with the cross-checking penalty, as every referee has a different interpretation.
The Chara cross-check is a more extreme example of cross-checking penalties getting let go. However, we often see the softest of cross-checks get called but then the referee will call something more vicious.