Yes, by logging into different websites using the Tor browser, you lose your anonymity since the website can fingerprint/track you. But by starting a new Tor session, you regain you anonymity. There is no permanent effect.
By clicking the
New identity button or closing the Tor browser and reopening it, all cookies/trackers placed on your previous session are cleared and a new Tor circuit is created (which is done every time a new website is visited anyways).
If you want a more in-depth version of what the
New Identity button does, visit: https://2019.www.torproject.org/projects/torbrowser/design/#new-identity.