Keep the recipient clear when you switch from a person's noun to ihm or ihr. Put the recipient pronoun before the named item in a neutral report.
der Freund means a male friend here: someone you know well and like. The plural is Freunde. In this setting you are helping a friend who has been mentioned: Ich helfe dem Freund. Use the prepared masculine dative dem after helfen. In other contexts Freund can mean boyfriend; no romantic relationship is intended in this task.
das Paket is a parcel or package being sent or delivered; the plural is Pakete. Ich habe ein Paket uses the familiar neuter accusative article ein. This is a physical postal item, not a software or service package.
ihm refers back to one male or grammatically neuter recipient. Ich helfe dem Freund. Ich helfe ihm. keeps the same friend as the person receiving help. With a child: Wir helfen dem Kind. Wir helfen ihm. The pronoun follows the noun's grammatical reference, not an imagined extra person. er is a subject form and cannot replace dative ihm; ihr would point to a different feminine referent.
ihr refers back to one female recipient: Ich helfe der Nachbarin. Ich helfe ihr. The same reference works with a teacher: Wir helfen der Lehrerin. Wir helfen ihr. This is third-person dative, not the subject pronoun ihr for several people you address. ihm would change the referent; keep the woman just identified.
In Ich schicke ihr ein Paket, ihr refers to the neighbour in the first sentence. In an ordinary statement, put the recipient pronoun before the item when the item is a full noun phrase: ihr ein Paket, or ihm ein Buch.