Basically what Jamcat posted.
For his #1, it's basically all you need to know. Foreign DNA = bad, so bacteria try to destroy it by using restriction enzymes which cut up the DNA in specific regions where a set sequence is (a given restriction enzyme cuts up a given sequence).
For #2 - look up "recombinant DNA" in Google. Restriction enzymes let you take a plasmid (circular DNA) and cut it up in 1 particular region (making it 1 straight piece of DNA). You can then take a certain gene and cut it (using the same restriction enzyme) and combine it with the cut up plasmid. You combine them by using DNA ligase.
Once combined, this plasmid + inputted DNA is called "recombinant DNA." It can be given to certain cells to make them express the gene that you stuck in.