If you’re using a digital datastream to control the GPIO that your relay is attached to then this is one of the things that happens.
You can get around the issue easily by switching to Using virtual pins…
If you’re already using virtual pins then the pinMode and virtualWrite solution described above is what you should do.
Also, it depends on your hardware. If you’re using an Uno for example the pin 13 always seems to do odd stuff on startup.