WD My Passport for Mac - Can anyone help me to format this drive (my attempts have failed)

Below are two screens that show my frustration with this WD My Passport For Mac drive - I have tried a combination of Partitioning, Repairing but I keep getting the same error " Cannot allocate memory".  This drive only has a few hours of usage but it is outside of the warranty period.

Screen 1: Trying to partition Failed

Screen 2: Trying to repair WD drive

Dude, I can’t see the pics.

Anyway, how are you trying to partition the drive? What partition map and file system?