TikTok ban. How does a divestment work?

So the house voted today to ban TikTok.

They said either divest from Bytedance or be banned from the USA.

My question is does ByteDance have to agree to a divestment? Or is it all up to TikTok?

Bytedance owns TikTok, so Bytedance will make the decision. I expect they will sell it to another company (at least the part that operates in the U.S).

It will not be easy to sell TikTok, according to the NYT (gift link):