The purpose of any scientific activity is to gain insight, to understand something, to advance knowledge in a field, to make some theory applicable etc. In any case, your are standing on someone else shoulders – a statement attributed to Isaac Newton (1642-1726), who revolutionized physics. Even a genius like Newton rarely creates something from scratch. There is always a basis, a foundation, work done by other people, we built our research upon.
The issue is: Give credit where credit is due!
In science, you do so by referencing the work (books, papers, articles and – in rare cases – web sites) of others your scientific outcome (books, papers, articles and – in rare cases – web sites) relies and is built on. It is a way to say “Thank you for letting me stand on your shoulders that helped me do my work.” This might include referencing private communication. Here, I don't mean any sort of assistance you received while you were stuck, but personal contacts, which decisively influenced your research by having research-related conversations, orally, by email etc. Give credit where credit is due!
The other issue is: Be honest about your contribution, no matter how tiny it is.
Most scientific work does not create a sort of Big Bang of insights, understandings etc. Mostly, science advances in very small, more baby-like steps. That's ok and there is nothing wrong with this. Do not feel bad about your tiny contribution to science. The point is: Make absolutely clear what the state-of-the-art in your field regarding your topic is and what your contribution is no one else did before. It is about making a difference, literally speaking.
You do so by summarizing and referencing the work of others relevant to your field. For that you need to carefully revise and inspect the current state-of-the-art. Sometimes that's not easy and requires you to do a lot of work, usually systematically searching databases covering the vast knowledge of your field and reading a lot of papers. Nonetheless, it is important work. To make a difference you need to show the difference no matter how small the difference is.
Not giving credit and letting your contribution appear more impressive than it actually is is regarded as an academic fraud. It is called plagiarism.
I hope you got the point: This one-pager is not about the technicalities to reference and quote other peoples work correctly. On this topic, there are tons of resources available elsewhere. “How to avoid plagiarism?” is about creating a mindset. It is a mindset of showing respect to others and being honest about your contribution. Make a difference – but without plagiarism.
Having immersed the mindset, you might understand why academia reacts quite drastic to uncovered cases of plagiarism. Students might get exmatriculated, researchers might loose academic titles and their jobs or positions. Plagiarism is not so much about a code of ethics but putting the scientific method at risk:
We cannot advance science by cheating on each other.