I managed to solve a little problem I had myself by reading and modifying.
My code works, but as a novice I would like to ask if you could advise me of a cleaner way to achieve the same thing.
Things look a bit messy to me, so I'm sure there is probably a better way to do this.
This code simply outputs a logo from the Wordpress Customiser.
Any advice or direction will be greatly appreciated.
<?php
$custom_logo_id = get_theme_mod('custom_logo');
$logo = wp_get_attachment_image_src($custom_logo_id, 'full');
if (has_custom_logo()) {
echo '<img src="' . esc_url($logo[0]) . '">';
} else { ?>
<img src='<?php echo get_template_directory_uri(); ?>/img/logo.png'>
<?php }
?>