Ockham’s Razor has nothing to do with shaving. It is a principle used in problem solving. The first part of the name comes from its attribution to a Monk, William of Ockham, who lived around thirteen hundred. The second part is because the principle involves cutting down possible explanations of something to the one with the least assumptions. In essence it says that simpler solutions are more likely to be correct than complex ones.
In Science Ockham’s Razor is not an absolute rule in the formulation of explanations. But there is wide acceptance that “simpler” is likely to be “better”, and that non-proven assumptions should be kept to an absolute minimum. It is an essential principle to keep in mind when trying to make sense of the complexities of Cosmology.