Hey pass the current user email id in get_avatar() function if user is logged in like this.
<?php
if ( is_user_logged_in() ) {
$current_user = wp_get_current_user();
if ( ($current_user instanceof WP_User) ) {
echo get_avatar( $current_user->ID, 32 );
}
}