As a researcher, you need to be aware of research ethics and good research practice in your field.
Depending on your field, you may be dealing with different ethical challenges. There are also general questions of good research practice that apply to all kinds of research, such as storing data appropriately and ensuring the transparency of the research process.
There are many different types of ethical and legal regulations, they are all binding to different degrees. Thus they constitute together a regulatory system, which can be hard to navigate and create confusion. Many universities maintain information about good research practice on their website, and many have a support system for researchers who have questions. For example, CODEX, a resource maintained at Uppsala University and aimed at all researchers in Sweden, aims to give researchers and other interested parties access to and information on the guidelines, ethics codes and laws that regulate and place ethical demands on the research process.
You should always consider ethical concerns and good research practices when planning and carrying out your research. Keep in mind that research that falls short of such standards may end up being unsuited for publishing or unusable towards your degree, so you should address your questions and concerns early on.