Tail hair: Likely, the same way you obtain tail hair of a horse. You yank the hair out (See KaOs' excellent answer).
Please note that they let humans (especially witches) near them as we see during lessons with Professor Grubbly-Plank, so the issue of "unicorns are too fast to catch" isn't necessarily important.
Horn: Unknown in canon. No word on that in either the main books, or Beasts, or Pottermore, or interviews.
One can speculate (given the fact that plenty are available - e.g. Harry sees them sold at Apothecary for fairly small amount of money - 20-odd Galleons; and we know they are also being sold to Muggles sometimes), that the horns are likely to be obtainable without killing the animal. But that's a mere speculation.
While Hagrid asked the man behind the counter for a supply of some basic potion ingredients for Harry, Harry himself examined silver unicorn horns at twenty-one Galleons each and minuscule, glittery black beetle eyes (five Knuts a scoop).