Elendil is described by Tolkien as the first king of Gondor.
After the fall of Númenor, Elendil and his sons Isildur and Anárion founded the realms in exile. Elendil established the northern kingdom of Arnor, while Isildur and Anárion jointly founded Gondor in the south. Tolkien’s histories nevertheless give Elendil the title of High King, and he is commonly identified as Gondor’s first king because the southern kingdom was created under his authority.
Elendil fought Sauron at the end of the Second Age and was killed during the siege of Barad-dûr. His sword, Narsil, broke in that conflict. Isildur then used the broken sword to cut the One Ring from Sauron’s hand.
Isildur succeeded Elendil as High King, while Aragorn was a much later descendant. Denethor was a Steward of Gondor, not one of its founding kings. These distinctions explain why Elendil, rather than those better-known characters, is the canonical answer.