The first question is whether or not you used a VPN along with encryption. Those do greatly help but would have to be used in the beginning (There are far more tactics but once again an extremely complex topic). The next is making sure you have a robust password and make sure that password is not being automatically entered/remembered. The next step is making sure the username is not remembered. Beyond that, you have to go around and delete accounts from the various websites you visit that you do not want to risk someone discovering. Keep in mind, the internet still exists, backups exist and archives exist, so traces will always exist, just whether or not things can be linked back to you. Either way, it takes a lot of effort that few would put in to dig up this information. Likewise, whether or not a site will hand over information that is discovered to be linked to you greatly depends on far too many factors to cover here. Could take far too many resources to get anything useful.
Keep in mind your phone, computers and tablets are typically logged. These logs vary from different ISPs. In short, without VPNs, they will know what websites you visit, what times you visited them, who you call and even where you go, if you haven't disabled any of the gps features. Then you have the issues of places like Facebook tracking what sites you visit. You will be amazed how little privacy we have.
You can factory reset your phone, but make sure to delete anything from Google Drive, Google Photos, etc. or they will come back if you setup the phone again, unless you create a new Google account. Once again, you can delete these accounts but to be honest, there will be an archive somewhere. But, just because it still exists, doesn't mean it can easily be linked to you nor does it mean your data can easily be gotten. Computers are a bit more complex if they use mechanical hard drives, the hard drives simply have to be destroyed as data recovery can be performed on them even if the data is erased. I will be destroying all my drives beforehand.
I know I wasn't particularly helpful, but its a very complex topic and the answers will vary from country to country and website to website. Long as you do the baseline of deleting accounts, resetting your phone, making sure usernames and passwords aren't easily guessed and so forth, it is hard for the average person to gather any useful data. Just knowing where someone went doesn't mean you will get access to that resource.