Whilst and while are two words with identical meanings—usually. But you can’t always use whilst instead of while.
Typically, Brits use whilst and Americans use whilst. That’s the main difference. When used as a conjunction or an adverb, while and whilst are interchangeable:
However, while can also be used as a noun and a verb, and whilst can’t:
from Grammarly Blog https://www.grammarly.com/blog/while-vs-whilst/