Gold will only have value if someone is willing to accept it in payment for something useful like food, shelter, fuel...
If you are shipwrecked on a deserted island gold is of no use whatsoever while a cow is of tremendous use and value.