I'm efficient (which here means "forgetful"), so I use Dropbox. It can automatically sync files between computers without you having to remember to initiate a sync. The free tier is large enough to handle a lot of text files, although it might fill up if you add larger files, too. I use a paid tier, which lets me have lots more space and a longer undo history, for the rare cases when sync clashes happen.
Other people prefer using Git (via GitHub, GitLab, etc), which is another great option if you are more diligent about committing your changes or are willing to figure out sync automatic scripts.
There are other options beyond those two, but these seem to be the most common.