The main way to avoid plagiarism is by acknowledging your sources through proper citation and referencing. We have a guide on how to reference most materials you will encounter, which can be found here. This guide covers APA, MLA, Harvard, and MHRA referencing styles.
Any submitted work is assumed to be your own except where you have clearly indicated and documented the use of external sources.
If you are copied extended portions of others words exactly as they appear in the source, then these must be placed in quotation marks and must be followed by an exact citation. Different referencing styles have different requirements for how many words a quote can contain before it must be shown as an indented paragraph, rather than just being contained in the sentence.
Even if it may seem obvious that you are quoting something, it is still required for all quotes to be followed by a citation and an entry in the reference list/bibliography.
To paraphrase means to take the meaning and content of something and make it shorter and easier to understand, usually by changing words here and there. It is okay to paraphrase short bits of text in an assignment as long as you cite the source where you originally got the information/idea. You need to make sure that it is clear to the reader that this idea has been sourced from somewhere else, and give the exact information of where you found it.
Including long sections of direct paraphrasing is not best practice. It is better to read several sources on the subject and form your own opinions on the topic, write those opinions down in your own words, and cite your sources.
Straight copy-and-paste is very easy to detect. Alongside this, it is very easy to detect when you have simply mixed up sentence order, or changed a few words for their synonyms in order to make the paragraph seem different from the source. The differences in style will be very obvious to the person marking your work, and if you have not cited the source, you will be penalised for plagiarism. Additionally, software like Turn It In can detect such copied and pasted sections and will highlight them to the lecturer/tutor.
TCD Library have an extensive plagiarism tutorial which can be found here.