The rule is that in "transforming" a declarative sentence into a question (or a negation), the subject inverts with the auxiliary verb.
He is acting like a hero. → Is he acting like a hero?
He has acted like a hero. → Has he acted like a hero?
If there is no auxiliary verb present in the declarative form, the appropriate form of DO is brought in as a 'dummy' auxiliary.
He acts like a hero. → Does he act like a hero?, not *Acts he like a hero?
He acted like a hero. → Did he act like a hero?, not *Acted he like a hero?
But BE is always treated like an auxiliary verb, even when it is the only verb present in the declarative form.
He is a hero. → Is he a hero?, not *Does he be a hero?
He was a hero. → Was he a hero?, not *Did he be a hero?
Note that until quite recently HAVE could be treated the same way as BE—even today you find speakers inverting non-auxiliary HAVE with the subject, though it is becoming rare.
Have you any kumquats today? is acceptable, although Do you have any kumquats today? is more usual.
The same considerations apply with negations.