Can you go to a cremation of a dead person as a Muslim? What are the rules in the diin concerning this subject?

Thank you in advance