Sad to say, but you can't stop the OS, or rather the iCloud sync service to be exact, from making these folders.
Any app or service you've tried on any Mac or iOS device, even once, that syncs with an iCloud account has a folder or a file(s) in ~/Library/Mobile Documents. That's what you are seeing when you click on "iCloud" in the Finder Sidebar.
For the life of that iCloud account. Apple Support has no way to remove these; I've checked myself.
In Mojave at least, Apple has taken the ability for the Terminal to even see the ~/Library/Mobile Documents folder or its contents, so you'd have to be on an older OS version than Mojave to see those hidden files and folders. Not that you'd want to; they're just infuriating to see them and have them be untouchable. I can see why Apple made them super-hidden. (On Sierra, you could see them; I've never been on High Sierra to have an opinion.)