How to calculate a standard deviation and average of a band specific

Dear,

I am new in Sentinel Hub and I need to download different bands from sentinel with the following statistical filter:

  1. I will download only band 08 of a historical serie with standard deviation of the Band 08 < 200
  2. I will download only band 04 of a historical serie with mean of the Band 04 < 250

So, I put here an example of code that I have used without success:

if (standard_deviation(B04) < 200) {
if (standard_deviation(B08) < 250) {
}
}

Please, can you send any idea? I have read some documents but I have not found anything until this moment.

Best,