The diagram shows a circular motion of a rectangular object.
The arrows on the circular path show the direction in which the object moves.
There is a force which keeps pulling the object towards the centre of the circle along the radius. Due to this force only, the object moves in a circular path.
If no force were acting on the object, it would have moved along a straight line which would be a tangent to the circle.
This force is called the centripetal force.
You can see that even if the body moves with a constant speed, the direction of motion is changing. Since velocity is a vector quantity, it is constantly changing. Which means that this is an accelerated motion.
We know that a force is necessary for producing acceleration. Centripetal force is producing it.
If we treat the object as a reference frame, it means that you should imagine as if you are sitting inside the object.
Since it's accelerating, it is a non-inertial frame of reference.
We know that in any non-inertial frame, a ficticious force known as pseudo-force acts in it in a direction opposite to the direction of the acceleration of the non-inertial frame.
Hence such a force appears to be acting in a direction away from the centre of the circle along the radius. This apparent force is called as centrifugal force.
The difference between them is that the former is a real force acting on the object and directed towards the centre.
Whereas the latter is a pseudo force which appears to be acting away from the centre and the object experiences it.