Changing variables for instanstiated object

I have an gun and a bullet. When a button is clicked, the gun spawns a bullet.

I’d like to have my code modular so different modifiers can directly influence the bullet and how it behaves. I have tried both of the following to get access to the variables that are in the bullets script which is instanstiated.

GameObject spawnedBullet = Instantiate(gameBullet, playerGun.transform.position, rotation);
float bulletStats = spawnedBullet.GetComponent<S_BulletBehaviour>;
bulletStats.bulletSpeed = 10f;

and also

GameObject spawnedBullet = Instantiate(gameBullet, playerGun.transform.position, rotation);
float bulletStats = spawnedBullet.GetComponent<S_BulletBehaviour>.S_BulletBehaviour.bulletSpeed = 10f;

which have’t worked sadly.

Really confused on how to approach this next.