Forget about doing it perfectly. And definitely forget about following the rules as they're written.
You'll figure it out as you go along, so long as you listen to your conscience.
You'll know it when you cross the line because your conscience will ping you.
If you listen, then you'll realize where the line was — discovering the unwritten and timeless code of ethics — and resolve to do it better next time.