Display recent posts with thumbnail

the_post_thumbnail() can only be used in “the Loop”. What you need is get_the_post_thumbnail(). (See details and code examples on the code reference page).

So something like:

foreach( $recent_posts as $recent ){
    echo '<li>';
    echo get_the_post_thumbnail( $recent['ID'], 'size', array( 'class' => 'alignleft' ) );
    echo '<a href="' . get_permalink($recent["ID"]) . '">' .   ( __($recent["post_title"])).'</a></li> ';
}

Where ‘size’ is whatever registered thumbnail size you want for the image.