Here's how it works:
* Hastily is an adverb, describing how something is done (in a hurried manner).
* Haste is the noun that refers to the state of being hurried or the act of hurrying.
For example:
* Adverb: She spoke hastily.
* Noun: He acted with haste.