One key way is to remove access to ways for committing it. For example, gun trigger locks and locked cabinets can help stop someone who wants to attempt suicide from getting to and using a weapon. You can also restrict access to things like knives, rope, pipes, and medication.