The article linked by the parent comment explains it well and references plenty of considered material. But the tldr is that committing suicide aligns with an active criminal/immoral act, while dying by suicide is a factual cause of death with many possible causes.
Consider how people would like your death, or the death of a loved one, described by others. And if you can't, maybe consider how others might be affected.