David used Goliath's sword to cut off the giant's head (1 Samuel 17:51). Both the sword and Goliath's head were taken as war trophies (17:54).
The ephod mentioned here might not be the priestly garment. Some passages suggest an ephod could also be a statue (Judges 8:27; 18:17).