The Broken Hero Sword drops only from Mothron during a Solar Eclipse after Plantera. How to start an eclipse with a Solar Tablet, make Mothron spawn and beat it.
The Broken Hero Sword is a crafting material in Terraria that only drops from Mothron, a rare flying boss enemy of the Solar Eclipse event. Mothron only appears after you beat Plantera, and it drops the sword with a 25% chance (43.75% in Expert and Master Mode).
You need one Broken Hero Sword for the Terra Blade, which makes it the last and usually the slowest part of that sword. A few eclipses are often needed before one drops.

What you need:
After you beat any mechanical boss, every new morning has a 1 in 20 (5%) chance to start a Solar Eclipse. It lasts the whole day, from 4:30 AM to 7:30 PM, and its enemies only spawn on the surface.
Waiting for that chance can take many days, so the reliable way is a Solar Tablet. Use it during the day and an eclipse starts right away. The tablet is used up.

The Jungle Temple opens with the Temple Key that Plantera drops, so you can farm fragments right after the Plantera fight (for that fight, see How To Summon Plantera). Note: A Solar Tablet does nothing at night, so wait for the morning before you use it.
Mothron has a 1 in 80 (1.25%) chance for every eclipse enemy that spawns, and only one Mothron can be alive at a time. The more enemies spawn during the eclipse, the more Mothrons you meet.

Kill the other eclipse enemies quickly, since each of them takes a spawn slot. The Death Sickle and other strong eclipse drops come along while you wait.
Mothron has 6,000 health (12,000 in Expert, 18,000 in Master) and 30 defense. It flies through blocks, chases you and lines up beside you before it charges. Its contact damage is 80 in Classic and 160 in Expert, and its fast charges hit even harder.

Mothron is most vulnerable while it lays eggs, because it stays still for a few seconds. Save your strongest attacks for that moment.
Fight it in a large, flat and open arena, such as a long row of platforms on the surface. Ranged and magic weapons work best. The Piranha Gun can kill it in about 20 to 25 seconds in Classic, and the Venus Magnum, Chain Gun and Crystal Serpent are good choices too. Melee players can use the True Night's Edge, the True Excalibur or a yoyo, with Turtle or Beetle armor to survive the charges.
Note: Don't let Mothron lay its eggs on a single floating block. It can despawn there without dropping anything, so remove stray blocks around your arena first.
Besides the Broken Hero Sword, Mothron drops these after Plantera:

If the sword doesn't drop, keep going until the eclipse ends at 7:30 PM, then use the next Solar Tablet the following morning. Each Mothron is a new 25% roll.
The Broken Hero Sword goes into the Terra Blade together with the True Night's Edge and the True Excalibur at a Mythril or Orichalcum Anvil. Its only other use is the Terra Toilet, a piece of furniture, so keep your first one for the sword.
For the full recipe, see How To Get The Terra Blade. For the first sword in that chain, see How To Get The Night's Edge.