There is no "best way" to invite people to a funeral or memorial service; it depends on what works for you and your situation. For most people, the "best way" is some combination of these methods: a handful of close family members and friends may receive phone calls, while other people might get emails or electronic invitations.
Invitations to a funeral or memorial service are traditionally extended over the phone, often with the help of family and close friends, who can assist in making calls. These days, many people send emails inviting family and friends to the service, which can cut down on the amount of time and energy that the you'll spend notifying people of all the service details.
More and more, people are sending electronic invitations through electronic invitation services. By using an invitation service, you can manage and keep track of people you've invited and reduce the amount of energy you'll spend communicating with people around service details. Depending on the service you use, there may be other features that can improve the experience for you and the people you're inviting, such as custom invitation templates or forums for invited guests to discuss the event.
If you're having a memorial service and have some time before the service, you might also consider sending out printed invitations. There are many companies that can help you create custom printed cards, which you can then mail out to the people you'd like to invite.