Arduino with relay and on-off rocker switch Help!

I think understand 38, but somehow I find it difficult to add the rest.... I'm getting so confused by these codes