Both images are 2 consecutive pages of my notes . In this theory , i was told to use z-distribution when the sample size is large ( more than 30) and the standard deviation of the population , σ is known) . However , in the 2nd image , i was told to replace σ with s ( sample standard deviation) . Which is correct ?

I think the first theory of using z-distribution when the sample size is large ( more than 30) and the standard deviation of the population , σ is known) is correct , and thereplace σ with s ( sample standard deviation) . is wrong. Am i right ?