My ford pickup

my truck seems to be having trouble going more than 30 mph in drive but i can go past 30 mph in 2nd how do i fix this

Providing any info at all might help.

Year, model, engine, mileage, early carbureted or late fuel injected, any Check Engine Light on, bucking and jerking, transmission slipping, or what?
Offhand, sounds like the trans is roasting. Have you considering checking the trans fluid and seeing if it’s brown, which means trouble?
That’s assuming it’s an automatic transmission of course.