Either go to the immigration office where the education extension was issued and buy a single re-entry permit for 1000baht
OR
get one at the airport before you fly out. Both Bangkok airports have re-entry permit counters open
****
. They charge 1200baht for a single re-entry permit (you don't need a form, copies or a passport photo) . .. Tell the officer when you stamp out you need a re-entry permit