Add this simple check to your foreach
loop:
<?php
$categories = get_the_category();
foreach($categories as $cat):
if ( $cat->name == 'Media' ) continue;
?>
<a href="<?php echo get_category_link($cat->term_id); ?>">
<?php echo $cat->name; ?>
</a>
<?php endforeach; ?>
You can check the category name against the list of categories:
<?php
$categories = get_the_category();
foreach($categories as $cat):
if ( in_array( $cat->name, array( 'Media', 'Other Category 1', 'Other Category 2' ) ) ) continue;
?>
<a href="<?php echo get_category_link($cat->term_id); ?>">
<?php echo $cat->name; ?>
</a>
<?php endforeach; ?>