What is the first science fiction story that considers the practicalities of getting to Mars, landing on it, and returning safely? I'm interested in stories that focus on things like consumables (air, food...) and are as realistic as possible given the science known at the time of writing. Stories like John Carter, where he magically appears on Mars, do not fit my bill. I will accept a story where, for example, Mars has breathable air if it was written before measurements of the Martian atmosphere were done in the real world. I acknowledge that all sci fi authors have to make assumptions and build a narrative.
I don't know how realistic is necessary, but a good guess might be "A Martian Odyssey" in 1934.
Since I don't know how realistic is necessary, I cannot tell for certain whether some 19th century Martian novel or a 1950s or 1960s story or novel would be the first sufficiently realistic Martian voyage story.
There were science fiction stories about interplanetary travel in the 19th century featuring spaceships sealed against the vacuum of space. And some of them involved landing on Mars, which was already a popular destination in the imagination.
And experts on those stories can discuss which of them were already realistic enough to count for the purpose of the question.
According to the Science Fiction Encyloppedia:
...Texts by Athanasius Kircher and Emanuel Swedenborg provide more elaborate speculations; and throughout the nineteenth century – as documented in George Locke's Voyages in Space (2011) – tales of occult Communication between Mars and Earth were not uncommon, though almost totally lacking in sf interest....
...Mars is the home of such a civilization in Percy Greg's Across the Zodiac (1880), and Robert Cromie's A Plunge into Space (1890) combines the sociological critique with an interplanetary love story. The anonymous Politics and Life on Mars (1883) particularly emphasizes the concerns of a nascent Feminism, as does the more interesting and readable Unveiling a Parallel: A Romance (1893) by Two Women of the West. An advanced Martian civilization serves as the backdrop for Lost-Race-type adventures in Mr Stranger's Sealed Packet (1889) by Hugh MacColl, as it does in Gustavus W Pope's A Journey to Mars (1894). Robert D Braine's Messages from Mars, By Aid of the Telescope Plant (1892) features one of the strangest Communications devices ever devised – a telescope with a lens harvested from the eponymous vegetation – and also some of the most biting attacks on Earthly (especially US) society...
There may have been other journey to Mars stories in this era. And some of the Martian stories might have been realistic enough to count.
In a later era, there were many pulp science fiction voyages to Mars, with greater and lesser degrees of plausibility.
"Via Asteroid" by Eando Binder (Earl and Otto) first appeared in Thrilling Wonder Stories, February, 1938, and is a relatively sober and realistic account of explorers on Mars, sent by radio.
But it is the second story in the "via" series and the explorers had already landed on Mars and been there for some time when it opens.
Presumably "Via Etherline" Thrilling Wonder Stories, October 1937, included radio reports describing the voyage, the landing on Mars, and the first adventures of the exploring group.
An earlier and more famous Martian exploration story is Stanley G. Weibaum's classic "A Martian Odyssey", Wonder Stories, July 1934, and its sequel "Valley of Dreams", Wonder Stories, November 1934.
Both begin after the first Martian expedition has already landed, but their ship obviously uses atomic rockets, the "atom blast", for propulsion. And the protagonist carries an oxygen tank with him to breath better in the thin Martian air.
If "A Martian Odyssey" is realistic enough to satisfy the question, then searching for earlier stories with sufficient realism will be necessary to find if it is the first.
If "A Martian Odyssey" is not realistic enough, but The Sands of Mars is, then searching for Martian stories between 1934 and 1951 will be necessary.
If The Sands of Mars is not realistic enough, then presumably some later 1950s or 1960s story or novel would be.
The Sands of Mars by Arthur C. Clarke, came out in 1951.
Martin Gibson, a famous science fiction author, is travelling to Mars, as a guest of the crew of the spaceship Ares. After arriving at Space Station One, in the orbit of Earth, from which all interplanetary journeys start, he begins the three-month trip to Mars.
Clarke's vision of Mars was based on what was known or imagined in the 1950s. The Martian canals were long discredited, but it was not thought that Mars had mountains or craters. Seasonal changes visible from Earth were thought to be caused by vegetation of the sort the novel describes.
Some of the technology shown had not changed since the 1950s. For example, carbon paper and typewriters are used on the interplanetary ship, and cameras have film. Similarly the social structures are similar to the time Clarke was writing. While a woman engineer is mentioned, most of the females on Mars are assumed to be secretaries or receptionists and the only names given in the book are of European derivation.
I'm not certain we'd consider this a hard-SF approach (the book itself is strongly oriented toward religious allegory) but C.S. Lewis published Out of the Silent Planet in 1938 -- with consideration for propulsion (not rockets), consumable supply, trip time, conditions in space on the way, and a (for 1938) more or less reasonable approach to atmosphere, native life, etc.
Mars (Malacandra, as the natives called it) was populated by at least two intelligent races and IIRC the air was described as "thin" but could be adapted to with some acclimation time.