FAT32 and exFAT are compatible with both macOS and Windows. It will erase all data to format a Windows drive to make it compatible with Mac. APFS and HFS+ are exclusive for macOS. FAT32 doesn't support a file size large than 4 GB.
If you want to use the external hard drive on both Mac and Windows PC, you can choose either FAT32 or exFAT. FAT32 is compatible with some older OS but the maximum file size for FAT32 on Windows is 4GB, and the maximum HDD partition size is 32GB. However, Files bigger than 4GB can be stored in exFAT, which supports the largest partition.
If you always need to switch between macOS and Windows using the same external hard drive, then it is advisable to format it to accept both OS. If you use macOS-exclusive file format such as APFS and Mac OS Extend, after you insert the drive on Windows PC, you can only read the data but can't write to it, you will not lose any data.
To select a file format just for Mac, you should choose Mac OS EXtend for macOS Sierra and earlier versions, and APFS for macOS High Sierra and later.
Read more: APFS vs. Mac OS Extended - Which Format Option is Better