In obsidian: use the <sup> HTML tag.

In Anki

  1. click the button or use the [Ctrl + Shift + =] keyboard shortcut, or
  2. enable source view and add the <sup> there.