The trust is usually written to allow this to happen.
If a house in a trust is sold then the will is usually written in a way that allows the Trustees to use some or all of the trust money to buy a different home which is held for the benefit of the liferenter on the same trusts.
How much the surviving spouse can then take out depends on what they agree with the Trustees (the Trustees will typically be the surviving spouse and the children).
It's probably easiest to use some examples.
Your house is worth £400k and your DH has passed away leaving his 50% share of the house in a liferent trust.
You wish to downsize (and the will is written so that you can sell the property) to a house worth £200k.
All of the Trustees agree to do this. The Trustees then decide how much of the Trust money they will use towards the purchase of the new home.
They may decide to purchase 50% of the new property along with you. So you and the Trust will each own 50% of the new home and have £100k in cash.
You can go out and blow that £100k however you like.
The £100k that is still in the Trust however, remains in the Trust (your DC don't get it yet). The money must be invested and any income (interest, dividends etc) go to you rather than the Trust.
So the Trustees must take account of both you and the beneficiaries of the trust and so invest that money in a mix of investments that provide capital growth (good for the beneficiaries) and income (good for you).
.
The Trustees may instead agree to purchase any other percentage of the new home (or none at all).
For example, if the Trust put up £150k towards purchasing the £200k house then the Trust would own 75% of the house and have £50k in cash. You would then own only 25% of the new house and have £150k cash.