How to have different variables in a script with different gameobjects using the same script

Hey, lets say i have two GameObjects that carry out the same actions, however in their script one has a faster speed than the other, how can i just change the variable of the speed in the script that is coming from a separate “Data” script like “playerData.gameObject1Speed”, and “playerData.gameObject2Speed” rather than having to create an entire new script and just changing those variables in them.

make a speed variable public then attach both of the game object then you can change there speed manually