This post describes an easy and safe way to install and test macOS Mojave beta. It uses a feature of the Apple File System, so this technique will only work if you're running macOS High Sierra and are using APFS.
Open Disk Utility and find the button to add a volume:
The great thing about APFS volumes (compared to regular partitions) is that they don't require you to erase your entire disk. You don't even need to reserve space for them, as APFS volumes share space and grow as needed.
Once you've created a volume, you're ready to download and install macOS Mojave.
Head over to https://developer.apple.com/download/ and download the latest beta. The installer will take you to the Mac App Store where you'll find the actual installer.
At the time of writing there's no public beta available yet, so you'll need to sign in with a developer account to get access to the beta.
The installer should run after it finishes downloading. When it asks you for a disk to install on, click Show All Disks...:
You should now be able to select your newly created volume and continue the installation process as normal:
When the system reboots, hold the Alt (or Option) key. This lets you select a volume to boot from. You should see either your volume, or a volume named macOS installer. Select that volume to finish the installation process and launch macOS Mojave.
To switch back to your main operating system, simply reboot and hold Alt (or Option) key again. When you're done testing, you can safely delete the volume to reclaim your disk space.
Enjoy the dark side!
If you've enjoyed my work or found it helpful, please consider becoming a patron. Your support helps me free up time to work on my books and projects.