SD stands for Sicherheitsdienst, and it was established early in the 1930s as an intelligence arm of the government. While Germany already had such an agency, called the Abwehr, it was led by Wilhelm Canaris, and Hitler did not trust him. Since he was not so secretly anti-Nazi, Hitler had reason not to.
So the job of the SD was to detect enemies of the Nazi State and arrest, disrupt or kill them. This gave them a huge amount of power, and in some ways they were even more feared than the Gestapo and the SS. Members were hand chosen from Gestapo and SS ranks, and while the agency ultimately answered to SS Reichsfuhrer Heinrich Himmler, Reinhard Heydrich was in charge of the men in it, and they competed to earn the fanatical Nazi's favor.