If u let ur goalkeeper come out of his box (press Y or triangle), he will use his head or a sliding to get the ball away from the goal, cuz he can't use his hands. Using his head, or slide, depends on how the ball comes towards him. The sliding tackle usually messes up his try, cuz theball easily bounces over the keeper, however the striker that was running behind it gets a full hit. This result in a yellow card.
Therefor it's important to time when to make the keeper come out and let him make the sliding at the moment the ball hits the pitch.