If you have been using WordPress (since 3.7), you would know that a new feature that allows you to auto-update WP and plugins was implemented.
But sometimes, you may come across that you can’t update it because of FTP Details not being found.
Easiest thing that you can do is open your wp-config.php file and add the following lines:
define('FTP_USER', 'username');
define('FTP_PASS', 'password');
define('FTP_HOST', 'localhost');
Replacing ‘username’ with the FTP login username and ‘password’ with your own password and ‘localhost’ with the location of your WP install (if it is different)