When reinstalling macOS and partitioning your hard drive, it's essential to follow the necessary steps to ensure a smooth and successful process. Here's a comprehensive guide on how to partition your hard drive while reinstalling macOS:

Backup Your Data
Before proceeding with reinstalling macOS and partitioning your hard drive, it's crucial to back up all your important data. You can use Time Machine to back up your files to an external drive or a cloud storage service.
Download macOS Installer
1. First, you need to download the macOS installer from the App Store. Go to the App Store, search for the macOS version you want to install, then download the installer.
Create a Bootable USB Installer
2. Create a bootable USB installer using the downloaded macOS installer. You can use tools like DiskMaker X or create the bootable USB using the Terminal on your current macOS system.
Boot from USB
3. Insert the bootable USB installer into your Mac and restart the system. While restarting, hold down the Option key to enter the boot menu. Select the USB installer to boot from it.
Access Disk Utility
4. Once the macOS installer loads, go to the top menu and select "Utilities" and then "Disk Utility."
Partition the Hard Drive
5. In Disk Utility, select your internal hard drive from the left sidebar. Click on the "Erase" button at the top of the Disk Utility window.
6. In the dialog box that appears, choose a name for the new partition. Then, under the Format dropdown menu, select "APFS" if you're using an SSD, or "Mac OS Extended (Journaled)" if you're using an HDD.
7. After selecting the format, click on the "Partition" button at the bottom right of the dialog box.
8. In the Partition window, adjust the size of the partition by dragging the divider between the two partitions. You can have multiple partitions by clicking on the "+" button and adding more partitions, if needed. Make sure to allocate the appropriate sizes to each partition based on your needs.
Install macOS
9. Close Disk Utility and proceed with the macOS installation by following the on-screen instructions. When prompted to choose a disk for installation, select the partition you just created.
Complete the Installation
10. Once the installation is complete, your Mac will restart, and you can then set up your new macOS system on the partition you created.
Conclusion
By following these steps, you can successfully partition your hard drive while reinstalling macOS. Remember to back up your data, create a bootable USB installer, access Disk Utility to partition the hard drive, and then proceed with the macOS installation. This process ensures that you have a fresh installation of macOS with the desired partition setup.