early 13c., "characteristic attire of a religious or clerical order," from Old French habit, abit "clothing, (ecclesiastical) habit; conduct" (12c.), from Latin habitus "condition, demeanor, appearance, dress," originally past participle of habere "to have, hold, possess; wear; find oneself, be situated; consider, think, reason, have in mind; manage, keep," from PIE root *ghabh- "to give or receive."
Habit is a custom continued so steadily as to develop a tendency or inclination, physical or moral, to keep it up; as, the habit of early rising; the habit of smoking. Habit and practice apply more often to the acts of an individual; fashion and usage more often to many .... [Century Dictionary]
Meaning "clothing generally" is from late 14c. Meaning "customary practice, usual mode of action" is early 14c. Drug sense is from 1887. The Latin word was applied to both inner and outer states of being, and both senses were taken in English, though meaning of "dress" now is restricted to monks and nuns. In 19c. it also was used of the costume worn by women when riding on horseback.
mid-14c., "to dwell, reside; dwell in" (obsolete), from Old French habiter, abiter "to dwell, inhabit; have dealings with," from Latin habitare "to live, dwell; stay, remain," frequentative of habere "to have, to hold, possess" (from PIE root *ghabh- "to give or receive"). Meaning "to dress" is from 1580s. Related: Habited; habiting.