「教師(きょうし)」：A teacher at a school or university.
It is used when introducing yourself and writing your professional name.
「先生(せんせい)」：A teacher at a school or university, or a profession (doctor, politician or lawyer).
It is used to call someone by their name.
or just 「先生(せんせい)」
However, unlike「教師(きょうし)」, you do not call yourself「先生(せんせい)」.
The word 「教師(きょうし)」 and 「先生(せんせい)」are similar in meaning, but there are differences. Pay attention to the differences and remember them.