Function added using `add_action()` not being called

A echo in functions.php, wp_enqueue_scripts or any other non-template file probably breaks the output due to a fatal error because of headers already sent. echo is not a proper way to debug. Delete the echo statements and check the HTML of the page, your css should be there. To debug, use error logs.

Other than that, your code seems correct; be sure to include wp_head() and wp_footer() in your theme. Those functions are needed to print the enqueued scripts and styles; then just do this:

 add_action('wp_enqueue_scripts', 'theme_styles');
 function theme_styles() {

    // You can use error_log, a native PHP function,
    // or any other custom log function
    if( WP_DEBUG ) {
        error_log('some debug information');
    }

    wp_enqueue_style('theme_styles', get_template_directory_uri() . '/foo.css');
  }