Please check this guide to learn how to fix this error.
Go to your WordPress Dashboard => Settings => Permalinks. Select Post name and click Save Changes. If the Post name option is already selected in your Permalinks settings, just click Save Changes.