Sometimes, the terms "attribution" and "citation" are used as synonyms. However, when discussing copyright licensing, the two terms have different meanings.
You use an attribution when you need to give credit to the creators of content that are covered by a Creative Commons license rather than Copyright. You'll know your content has a CC license, because it will tell you.
A great tool to help you create an attribution is the Open Attribution Builder from Open Washington.
The Creative Commons wiki entitled, "Best practices for attribution" tells us that a good way to remember the elements required in an attribution, is to use the acronym TASL, which stands for Title, Author, Source, License.
Title - What is the name of the material?
If a title was provided for the material, include it. Sometimes a title is not provided; in that case, don't worry about it.
Author - Who owns the material?
Name the author or authors of the material in question. Sometimes, the licensor may want you to give credit to some other entity, like a company or pseudonym. In rare cases, the licensor may not want to be attributed at all. In all of these cases, just do what they request.
Source - Where can I find it?
Since you somehow accessed the material, you know where to find it. Provide the source of the material so others can, too. Since we live in the age of the Internet, this is usually a URL or hyperlink where the material resides.
License - How can I use it?
You are obviously using the material for free thanks to the CC license, so make note of it. Don't just say the material is Creative Commons, because that says nothing about how the material can actually be used. Remember that there are six different CC licenses; which one is the material under? Name and provide a link to it, eg. http://creativecommons.org/licenses/by/4.0/ for CC BY.
→ If the licensor included a license notice with more information, include that as well.
Lastly, is there anything else I should know before I use it?
When you accessed the material originally did it come with any copyright notices; a notice that refers to the disclaimer of warranties; or a notice of previous modifications? Because that kind of legal mumbo jumbo is actually pretty important to potential users of the material. So best practice is to just retain all of that stuff by copying and pasting such notices into your attribution. Don't make it anymore complicated than it is -- just pass on any info you think is important.
→ Regarding modifications: Don't forget to note if you modified the work yourself. If you are at the point where you are creating and licensing derivative works, see Marking your work with a CC license.
"CC Wiki: Best Practices for Attribution" by Creative Commons is licensed under CC BY 4.0