[sentence]。だが、[sentence] [sentence (polite)]。ですが、[sentence] [noun] / [na-adj] + ですが、[sentence]
だが means "but", "however" at the start of a sentence: the new sentence goes against what the last one led you to expect. It belongs to plain-form writing – essays, news, novels. ですが does the same job in polite speech and writing.
The choice is register. しかし is the standard written "however". だが is just as written and a little more forceful; said aloud it sounds stiff and dramatic. In conversation, use でも.
Match the register of the sentences around it: だが goes with plain-form sentences, ですが with polite ones.
ですが also joins two clauses within one polite sentence, after a noun, a な-adjective or an い-adjective + です. In plain writing the clause ends in the plain form and が follows it directly; an い-adjective takes no だ there.