In Unity, prefabs can’t keep reference with scene objects, only within their own local hierarchy. To create the reference (“remembering”) at runtime, you need to find that object with some other means. The easy but potentially less robust solution is finding by tag (or name, but avoid using name, because you might rename later). Finding by tag is perfectly fine, but not ideal if this issue comes up thousands of times.
The more elaborate and robust solutions are the domain of controllers or managers, two different styles to manage objects. These are dedicated objects that keep track of objects and references.