Sort a string by a given ordering
Python 3, 50 47 46 44 bytes

-3 bytes thanks to ngn!

-1 byte thanks to mypetlion



lambda a,s:s.sort(key=lambda c:a.find(c)%27)


Try it online!

Takes in a string as the alphabet and a list of chars as the string and sorts the list in place.

The %27 ensures that if the character is not in the alphabet, the index returned puts it after the rest of the alphabet.