How would I turn this code into a function?

I have literally no clue what your doing in that line of code