How do you make sure you don't plagiarize unintentionally?
Use citations for relatively recent work that is not your own (an exception to this is the idea of &quot;common knowledge&quot;. For example, you don't need to reference Newton or Leibniz when you employ calculus).
You are not plagiarizing when you develop layers of references and then build on that body of knowledge to add a contribution to it (and hence, becoming part of the body).
When you state a fact, result, argument, assertion, etc, that is not your own but that of someone and do not use a citation, then you are plagiarizing because your readership will interpret that part of the paper as an original thought of your own.
Using citations properly is a skill you will develop over time, so do your best to cite everything that you think requires a citation early on and then you can always edit down things later. As time goes on, you'll understand what does and does not require citation.