truck runs fine,after driving sometimes for awhile sometimes not, it acts like on 1998 Dodge Ram 1500

it`s running out of gas,but then it keeps on going,several friends have told me different things to check,but it would be nice to know what itis for sure instead of guessing. ty

Asked by for the 1998 Dodge Ram 1500
Test fuel pressure when it's acting up. -----MIL on? Get 'fast' codes----- LED odometer? Cycle key---ON-OFF-ON-OFF-ON-----------watch ODO. display for codes and post here or guess.......code is not necessarily the fix , just a source of the possible cause...................Did someone put rice crispies in the gas?
1 more answer , 1 more comment
check fuel pressure
I can probably do that but sometimes you can drive it for a week or better & it never acts up don`t understand it