As a noun:
* The most important attribute of a good leader is integrity. (refers to a quality or characteristic)
* She attributed her success to hard work and dedication. (refers to something considered to be the cause of something else)
* The antique vase was attributed to a famous potter. (refers to assigning something to a specific creator)
As a verb:
* I attribute my good mood to the beautiful weather. (refers to assigning something as the cause of something else)
* Historians attribute the fall of the Roman Empire to a number of factors. (refers to assigning something as the cause of something else)
Other uses:
* The HTML code uses attributes to define specific properties of an element. (refers to a specific aspect of a computer code)
The best way to use "attribute" depends on the specific context and what you are trying to convey.