The correct option is A (a)
The option, with the error in it, is the correct option.
Option A: The error lies in the part "As I prefer coffee than tea". 'Prefer' is usually followed by 'to' and not 'than' because the word itself means 'like something/someone more than another'.
So, the corrected form would be: "As I prefer coffee to tea". ('To' here refers to the relationship between coffee and tea.
Hence option B is correct.
Option B: There is no error in the part "my friends always take the trouble", it agrees to the rest of the sentence. Hence B is incorrect.
Option C: Similarly, the words "of getting me a cup of coffee..."
also do not contain any error. Hence C is incorrect.
Option D is incorrect because the error lies in A.