Let's say that a family member or someone we know wasn't really good and much practicing.
Even if they were sinners or not practicing we still should not assume that they are being punished in the grave as only Allah knows that. However we should certainly make lots of Dua's for them for their forgiveness, especially close Muslim family members, relatives and friends etc as well as for the believers in the graveyards in general. We can certainly say in our Dua's that if this person is being punished then for their punishment to be eased.
If we can afford it then we can pay off any debts that they owed and pay or fast towards any broken oaths or pledges that we know of that they had not fulfilled. We can also calculate and pay any Zakaat they owed during their lifetime that we know they did not pay, and do Hajj on their behalf if they did not make Hajj and also make up for any obligatory fasts that they owed.
We can also do voluntary good deeds and make intention to donate it towards them like various types of charity. Although there is a difference of opinion with regards to reciting Qur'an and donating it towards the deceased Muslim but many great Scholars have allowed it. Al-Suyuti (Ra) said in Sharh al-Sadurr, "There is some differences of opinion about whether the recitation of the Quran arrives to the deceased. The majority of the Imams and the Salaf agree that it does arrive [benefit them]."
Imam Al-Shafi (Ra) was asked about recitation at a grave. He said, "there is no harm in it." Meaning that it is permitted.
Imam Kamal ibn Humam (Ra) said in Fath al-Qadir, "Whoever does a righteous action for someone [can] benefit them by Allah. This reached us by mass transmission." Meaning that benefiting the dead by any good action is tested and well known to have worked.
Al-Badr al-'Ayni (Ra) confirms this in the commentary of Kanz. This is also confirmed in Al-Darr Al-Mukhtar by Imam Al-Musuli (Ra).
Imam Qarafi and Shaykh Abu Zayd al-fasi both confirm this (Ra).
And Allah knows best in all matters