I just realized that you got the computer used from your friend. Before anything is done, it must be setup per the directions in What to do before you sell, give away, or trade in your Mac. Most people that get used Macs from unauthorized (friends, e-bay, craigslist, marketplace, local computer store, etc..) do not have the machines setup for you in advance so it is left to you to do.
If you ignore or do not follow the directions your experience will continue to be very poor and the computer will not run correctly. If you need to, you may have to have your friends assistance if his passwords are required.
In retrospect, you also may just want to consider taking the computer to your local third party (non Apple Store) Apple Authorized Service Provider who can help you as they have the knowledge and proper tools to work on the system. We see do-it-yourselfers all the time that in their attempt to save money either end up spending more money or simply wasting their time and efforts. My suspicion is you don't have much experience working on Macs or Mac OS so it may be in your best interests to take this step. If you don't know of any third party AASPs in your area, please click Apple Authorized Service Provider Locator (AASP) & Genius Appointment or you can call AppleCare and they can help you find one make an appointment for you. AppleCare Contact Info
Good luck!