I need to put a different engine in my 1982 Ford Ranger Lariat and I don't know what to put in it?

It's the biggest engine you could get at the time in those trucks, so it is a v8, I just don't know the exact size. Since the engine is pretty much dead that's in it I was wondering if almost any v8 could go in it's place or if it has any specific engine that has to go it in. Also any good suggestion for a good engine would be great.

Define what is "pretty much dead"? Figure out exactly what you have, it may be worth rebuilding, depending on what it needs could be cheaper than swapping.

Or if you look around at crate motors, Jegs has a Ford 408 345hp for around $3300, that's about the cheapest thing I see that looks like decent power for a truck:

http://www.jegs.com/webapp/wcs/stores/servlet/KeywordSearchCmd?No=0&Nty=0&catalogId=10002&Ns=P_Price%7c0&Ntk=all&Jnar=0&Ne=1+2+3+13+1147708+1+1500000&itemPerPage=90&langId=-1&storeId=10001&N=1010763&Ntt=ford

The 400 was the biggest engine for 1982, the 460 came back in 1983. If you have a F100 or F 150 the biggest engine was a 351, either a 351 W or a 351 M. The 400 and the 351s all had 136 HP. Swapping engines is a bit of a headache unless you have a parts truck with the engine you want. You probably want to replace it with the same engine. If you are lucky to have a 351W, they had 210 HP in the late 80s through the mid 90s.

More than likely it's a 460. 1977 was the last year for the 390. You could use a 351M, 400, 429, or 460 given the trans bellhousing you have. It should be 9-1/8" center-to-center across the top two bolt holes.

Yep - Most any thing will fit, from a straight six to any big block you want. I think the biggest that came from Ford was the 390, but the 390 is just a smaller version of the 428, so that would be a good choice.