Asking about how to write code as in practice labs

I need to know how to write code and understand each line in the practice labs, is there any way to help me understand them then write them by my own way

Duplicated. See Asking about how to write code as in practice lab