Let us create a simple example to get familiar with the function. Simple vector with 10 elements.
x<-c(2,3,1,1,1,1,1,1,3,2)
sum(x)
#> [1] 16
mean(x)
#> [1] 1.6
Created on 2020-09-26 by the reprex package (v0.3.0)
Then we go ahead and remove 1 element from each end. So we have element 2 to 9 (after ordering). 1 and 3 are removed. We are trimming 1/10=0.1 from each end.
x<-c(2,3,1,1,1,1,1,1,3,2)
x[order(x)][2:9]
#> [1] 1 1 1 1 1 2 2 3
sum(x[order(x)][2:9])/8
#> [1] 1.5
mean(x,trim=0.1)
#> [1] 1.5
Created on 2020-09-26 by the reprex package (v0.3.0)
Hope this helps.