Depends on your location and surroundings, most people opt for jumping in front of trains right before they pass, however doing it that way could lead to more injury than death, depending on the speed
It's pretty simple to CTB just by laying down, neck on top of the rail, however, this still is cruel to the rail workers nonetheless.
NYC Subway Operators for example suffer major PTSD from suicides/homicides, so I personally would try to steer you away from the train method, as it is unethical.
In my opinion, if you are having a hard time getting over the decision, maybe it's possible to reschedule, research, and contemplate, instead of CTB spur of the moment on impulse.