The best and easiest way to avoid plagiarism is to make sure that your work is entirely original.
Of course that is really hard to do, if your teacher has asked you to write a research paper. If that is the case, you need to give credit where credit is due. If you are using the exact words from another author or source, then it needs to be in quotes. That quotation needs to then be cited in proper format. Even if you are paraphrasing somebody else's ideas or words, you must give that person credit by alerting your reader with a citation. Any in text citations that occur also need to be fully cited in a "works cited" or bibliography page. I always tell my students that if they are in doubt about whether or not they should cite something, they should cite it to be safe.
Depending on the subject content, you might have to cite in APA or MLA format. MLA is generally used in literature, while APA is generally used in history and the sciences. Making a works cited page has become a lot less tedious than it used to be, because there are a number of good online generators. I'll link a couple below.