First you need a well-anchored vise.
Then you need some sort of a fixture to hold the upper receiver in the vise while you remove/install the barrel nut. I'm an AR15 armorer and have all the tools for that, but the 308 receiver is bigger and doesn't fit in the AR15 fixtures. I just sandwiched mine between a couple of spruce 1x6's in the vise with the receiver on its side, sortof like this:
If you want to invest in the proper fixture tool, something like this is what you'd need (though I'd still use it on its side like the pic above so you're not transferring the torque force to the takedown pin lugs on the upper receiver:
DPMS .308 Upper Receiver Block : AR-15/AR-STYLE .308 UPPER RECEIVER BLOCK | Brownells
The trick about the barrel nut wrench on the M&P is that it's AR15 pattern, but the ID of most AR15 wrenches is too tight. I have and use this PRI model, but you'll need to open the inside to fit around the barrel:
AR-15/M16/AR-10® BARREL NUT WRENCH | Brownells
Here's a thread from another member showing the steps he took to install his TRX forend that you might find useful:
M&P 10 with Troy Handguard and VLTOR stock