Theres a bunch of options!
Your sim can die of age, just let it happen naturally or... 1.press CTRL-SHIFT-C
2.type in testingcheatsenabled true
3.shift click the sim
4.press trigger age transition until your sim dies.
They'll have a light grey ghost.
They can die of hunger, which can also happen naturally if you leave your sim alone until they die of hunger, or (Do the procedures 1-2) and go to the 'needs' panel, drag hunger down all the way and tada, they die! They'll have a plain purple ghost.
They can die of drowning, I do this alot if I dont want a sim. this cannot happen naturally! first you need to make a pool, put your sim in it, while they're swimming, build a wall around the pool so that your sim can't get out of it, let them swim around until they get stressed and drown. They'll have a blue ghost with water dripping off of them.
They can also die of fire. now this happens alot to sims who invent, sculpt or cook. if you dont want them to die, keep a sim, alarm, or pool around. I dont know of a cheat for this, but if your sim doesn't have a good skill at anything, try inventing, sculpting, or cooking. They'll have a red ghost with flames inside of them.
Last one, woo!
Your sim can be eletricuted fatally (Another one without a cheat, darn!), I've seen my inventor sim get eletricuted when she was inventing (Though not fatally.) But if your sim has a poor handy or inventing skill, try getting them to fix a tv or some appliance, or make them invent something. they'll have a yellow ghost with sparks inside of them.
Thanks for reading and have fun using these! =)