IF condition based on wp_remote_get output

Following would be the revised example code which you may want to try.

function display_api_response() {
    $api_url = "https://randletter2020.herokuapp.com";
$response = wp_remote_get($api_url);
   if ( 200 === wp_remote_retrieve_response_code($response) ) {
        $body = wp_remote_retrieve_body($response);

        if ( 'a' === $body ) {
          echo 'A wins';
        }else {
          // Do something else.
        }
   }
}
add_action( 'init', 'display_api_response' );

Here, you may want to replace init action with something else suitable to your requirements.

Please refer wp hooks for appropriate actions: https://codex.wordpress.org/Plugin_API/Action_Reference