Hi and welcome, goliver5!
What software are you using for localhost? For example, WAMP, MAMP, Uniserver, Xampp, etc. Also, are you using a Mac Windows operating system for your computer?
Either way, all you have to do is go to where you installed Wordpress. So the same folder that contains your wp-admin folder, wp-content folder, and wp-includes folder. Then, in there create a "wp-config.php" and paste your code into the file. You can use an editor to do that or depending on your laptop, right click and create a new file.
Let us know if you have any questions.
Kind regards,
Nick