Ukrainian verbs can have one of two aspects: imperfective and perfective. The imperfective form denotes an action that is taking place in the present, is ongoing, is repetitive, or is habitual. The perfective form indicates an action that is completed, is the result of an action, is the beginning of an action, or is shorter or longer than usual.
If you say "Мій друг написав книгу," (prefective) then we know that the process of writing was finished and your friend is not writing that book anymore.
If you say "Мій друг писав книгу," (imperfective) then we know that the process of writing the book took place in the past. Probably it was a habitual action, e.g., it took place every day. It may be that your friend is till writing the book, or not. We don't know.