A king is usually a male monarch who rules a country or territory which is a monarchy. The person usually inherits the title and position. A king comes to power when the previous monarch dies, who is usually a family member of his, most likely a parent. Sometimes a person may become king due to the previous monarch's abdication, for example George VI (who became King of Britain after his brother decided to abdicate).
If a country has a king or a queen, that means it is a monarchy. A country which a king or queen rules is called a kingdom.
For most of history, most countries were ruled in this way, especially in Europe. However, most countries, such as France, decided to become republics. Some, such as the United Kingdom, still have a royal family. In some countries, people chose a new king from other people to decide from.
The wife of a king is called a queen. A woman who becomes a ruler because of inheritance is also called a queen.
If there is a queen without a husband she might be inducted as the king in certain monarchies in Africa and Europe. Her Royal Majesty Queen Diambi is the current female king of the Bakwa Luntu People of Central Kasaï, in the Democratic Republic of Congo.