The Head of State is the highest or one of the highest-positioned persona in a public office. They may have many different roles, titles, rights, duties, and levels of significance in general based on numerous principles. Primarily, these principles are the form of government and the structure of the state. Further, they are, in general, the heads of the executive branch. They are presidents or monarchs.
Nonetheless, the ultimate goal of the Head of State is to represent the country/state both at home and outwardly. No matter if the role, they give the state some form of identity and coherence. They can be either ceremonial or have more comprehensive rights.
For example, in a presidential system, they also hold the title of Head of Government. On the other hand, in a parliamentary system, these roles are separated. The Head of State is also more ceremonial in this system. Similarly, the functions are different in a republic and monarchy. Citizens elect them in a republic. In a monarchy, the position is hereditary.