wordpress error 404 is one of the most common problem people search on internet and today we have the solution
i have this problem before and search how to solve it and finally solve it , there is 3 reasons why you have these errors
the permalink : in your wordpress setting you have permalinks section you can change it to Post name or Numeric and click save and that’s it if the problem came out from the links every thing well be okay

if the problem still and if you cant login to your wordpress dashboard what you can do is change your .htaccess file based in public from your cpanel
login to your cpanel and go to file manager and go to your wordpress direction NOTE: you should apply show hidden files because .htaccess start with dot and it is hidden file , what you need to do is to edit the file and add this code into it and save it
the code
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
#
END
WordPress