how to prevent all css and javascripts files from loading

I’m not really sure why you’d want to do this…but the only thing I can think of that might work is something like this:

     function prefix_block_resources(){
         if(is_admin())return;  //I can't imagine any scenario where blocking scripts in the admin area would be wise.
         global $wp_scripts;
         global $wp_styles;
         $wp_scripts->queue = array();
         $wp_styles->queue = array();
         return;
     }
     add_action('wp_head', 'prefix_block_resources');

That will block any styles and scripts that have been loaded using the WordPress API, it won’t do anything about styles/scripts that have been hardcoded into the theme.