cost (n.)

c. 1200, "price, value," from Old French cost "cost, outlay, expenditure; hardship, trouble" (12c., Modern French coût), from Vulgar Latin *costare, from Latin constare, literally "to stand at" (or with), with a wide range of figurative senses including "to cost," from an assimilated form of com "with, together" (see co-) + stare "to stand," from PIE root *sta- "to stand, make or be firm."

The idiom is the same one used in Modern English when someone says something stands at X dollars to mean it "sells for X dollars." The meaning "equivalent price given for a thing or service rendered, outlay of money" is from c. 1300. Cost of living is from 1889. To count the cost "consider beforehand the probable consequences" is attested by 1800.

In phrases such as at all costs there may be an influence or echo of obsolete cost (n.) "manner, way, course of action," from Old English cyst "choice, election, thing chosen." Compare late Old English alre coste "in any way, at all."

cost (v.)

"be the price of," also, in a general way, "require expenditure of a specified time or labor, or at the expense of (pain, loss, etc.)," late 14c., from Old French coster (Modern French coûter) "to cost," from cost (see cost (n.)). Related: Costing.

Others are reading

Definitions of cost from WordNet
cost (n.)
the total spent for goods or services including money and time and labor;
cost (n.)
the property of having material worth (often indicated by the amount of money something would bring if sold);
he couldn't calculate the cost of the collection
Synonyms: monetary value / price
cost (n.)
value measured by what must be given or done or undergone to obtain something;
the cost in human life was enormous
Synonyms: price / toll
cost (v.)
be priced at;
These shoes cost $100
Synonyms: be
cost (v.)
require to lose, suffer, or sacrifice;
This mistake cost him his job