In order to close your Yahoo account, visit this page, login with your credentials, and follow the on-screen instructions. You’ll need to re-enter your password, enter a CAPTCHA, and click on “Terminate this Account”.
Here’s an example of the page in question:
If you did everything correctly, you should receive a confirmation that the account was indeed deleted. It will look like this:
Keep in mind that if you close your account, all your Yahoo services will be shut down along with your personal settings.