Canadian Prime Minister Justin Trudeau has announced his resignation, telling the media that "internal battles" mean he "cannot be the best option" in the next election.