browser showing connection was reset while accessing posts from local host

It was syntex error in my functions.php which causing the error.
In the if statement it was not wp_enqueue_scripts. It was wp_enqueue_script