Just follow the simple strategy of: Announce your departure. Make a pause. And announce your new role.
By announcing your departure it’s the right time for you to thank your previous employer. Then a give some time starting in your new role in order to make this announcement. Mention your gratitude to your hiring responsible and your boss for the chance they give you, while don’t forget to state your happiness for your new beginning.