Hello, I believe I know what you're looking for.
1) Gather your files that you want to encrypt and put them in a folder.
2) Your Mac includes a program called "Disk Utility". I always locate it quickly by simply doing a Spotlight search for "Disk Utility".
3) Launch Disk Utility and in the upper left menu, select File > New Image > Image from Folder...
4) You'll then select the folder you created in step #1.
5) You'll end up with a .DMG file that is an encrypted folder containing your files, and requires a password to open.
6) You can then sync that new DMG to iCloud. Should someone gain access to your iCloud they'd also need the password to the DMG in order to see your protected files.
Tip #1: Choose a very, very strong password and when you use it for the first time it'll give you the option to save the password in your Keychain. Once the password is saved in your Keychain it'll open automatically on your personal computer without the need to enter the password each and every time.
Here is Apple's documentation about Disk Utility. You probably want to read the section called "Create a secure disk image"
https://support.apple.com/guide/disk-utility/create-a-disk-image-dskutl11888/mac
Hope this helps