How does a heat engine work?

Can you answer this question?