If you mean you were following the instructions within this Apple article:
Change the name of your macOS user account and home folder - Apple Support
then you must have missed one of the steps. All of the steps must be performed correctly (only one step is optional). If you still have another working macOS admin user account, then log into that admin user account & correct the mistake by using the Apple article I linked.
Otherwise you will need to perform a clean install of macOS which includes erasing the disk (or Volume Group) followed by installing macOS & restoring from a backup made before this problem occurred.
Edit: If you don't have a backup, then you should still be able to access the data from another macOS admin user accounts, although it may be a bit tricky due to permissions issues & locating the now broken home folder that is no longer associated with the current login which you changed. The third party app Carbon Copy Cloner can make it easier to access files from another account/area, but requires a working admin user account to authenticate.