By default, WordPress leaves its footprints on your site for the sake of tracking. In sometimes this footprint might be a security leak on your site if you are not running the most updated version of WordPress.
There are two ways.
1. Custom code in function.php
remove_action('wp_head', 'wp_generator');
add_filter('the_generator', function(){
return '';
});