Remove the deck assembly from the riding mower. Turn the deck upside down and block the blade with a piece of wood so it can't turn counter clockwise. Loosen the bolt that holds the blade on the mandrel shaft then snug it back on to hold the shaft while you remove the nut that holds the pulley on the top.
Leave the blade blocked with the wood and turn the deck half way upright and loosen the nut that holds the pulley on. Remove the pulley and check for any spacers under the pulley. If there are spacers you need to put them under the pulley when you install it on the new mandrel,
If you have an impact wrench it makes removing this nut much easier. If you don't have an impact wrench, block the blade with a piece of wood so it can't turn and use a boxed end wrench as long as you can find. You will probably need a cheater bar for the wrench. It is hard to break the nut loose.