Starting problems come from either spark, fuel, or compression issues. The way to approach this is to determine whether you're getting spark at the plugs; fuel in the lines, and check the compression to see how much pressure is being built up in the cylinders. There usually will be an obvious problem in one or more of those areas.
There were four different engines used in the 2002 Dakota: an inline 4
cylinder; a V-6, and two different V-8s. These engines do not all have
the same parts on them. That is why we can't be specific about what and
how to do unless you tell us which engine is in your truck. There originally was an emission information label on the underside of the hood, or near the top of the radiator; which lists the engine type.
One thing that is simple to do is to remove the distributor cap (used on all engines except the 4.7 liter V-8) and see if the rotor is spinning when the starter runs. If the rotor does not turn with the starter; this means the timing chain has broken.
Once the cause is narrowed down to one of the 3 areas; the thing to do is to inspect and test the component parts of that system until you find the failed element.
This sounds simple; but since you asked this question; I assume you are not mechanically experienced, and might not even have the tools or ability to analyze these systems. In that case; there is only so much you can do by yourself.
It would also be helpful if you tell us whether the truck has any repairs done on it recently; whether it is overdue for maintenance or a tune up, whether it ran normally up until the time it wouldn't start; or whether it was having problems, whether the check engine light was on, whether it made any unusual noises or overheated, or ran out of gas before it wouldn't start. If you want to post the needed details; do not open a new question to do so. Just click the "answer this question" button, enter your message in the box that appears, and click the "submit answer" button.
It would also be useful to know whether you have tools and how much mechanical experience you have. Perhaps you intend to take the truck to a mechanic, and just want to know what to tell the mechanic to check. We need to be clear about your intentions and capabilities.