Convert string or word to 4 bytes

Should work; but, I prefer to follow the the syntax/semantics rules of the function prototype.
void *memcpy(void *dest, const void *src, size_t n)

Then, ptrS = (long)&y;* should also be like?:
ptrS = &y;

What is ptrS? If it's a pointer to a long, it will not need the cast. If ptrS is a pointer to a byte, you will need to cast to byte. You can check what the compiler thinks; it will warn you if it thinks it's incorrect.

In the following example, the casting (byte*) is necessary even though the destination is a byte-organized memory space.

float y = 13.67;  //415AB852
byte myData[4];

void setup()
{
  Serial.begin(9600);
 float *ptrS;
  ptrS = (float*)&y;

  byte *ptrD;
  ptrD = (byte*)&myData;
  

  memcpy(ptrD, ptrS, 4);

  for (int i = 0; i < 4; i++)
  {
    byte z = myData[i];
    if(z < 0x10)
    {
      Serial.print('0');
    }
    Serial.print(myData[i], HEX);
    Serial.print(' ');
  }
}

void loop()
{
}

Output:
52 B8 5A 41 //lower byte is printed first

In your example, yes. It's because you did place an & in front of myData which does not make much sense as myData on it's own is already an address because it's an array. Below works just as well (no compiler warnings)

  float *ptrS;
  ptrS = &y;

  byte *ptrD;
  ptrD = myData;