A soldier, line soldier, or trooper was a participant of a military conflict, or any member of a military, irrespective of position.
The Takret Militia called their subordinates soldiers. (ENT: "The Catwalk")
The immortal Flint once referred to his first life as Akharin, saying that he was "a soldier, a bully, and a fool". (TOS: "Requiem for Methuselah")
In 2364, Q appeared to the crew of the USS Enterprise-D as a soldier of the World War III Earth Army. (TNG: "Encounter at Farpoint")
Bajoran First Minister Shakaar Edon remarked to Odo in 2372 that "You know, I've been a soldier, and I've been a politician. And I have to say I'm beginning to think that... being a soldier was easier." (DS9: "Crossfire")
Following the Occupation, Bajorans no longer followed the D'jarra caste system. In 2372, Akorem Laan remarked that "Artists have become soldiers, priests have become merchants, and farmers have become politicians." (DS9: "Accession")
Though not strictly a military organization, Starfleet sometimes put its members in the position of being soldiers. Miles O'Brien often talked about his time as a soldier while fighting the Cardassians. (TNG: "The Wounded", DS9: "Past Prologue", "Empok Nor")
In the script's penultimate scene of ENT: "Fortunate Son", Doctor Phlox recited Voltaire by saying, "A fortunate soldier who serves his country well has no need of ancestors."