How should I rewrite 我昨天卖了我的电脑给他 using 把 and 了?
把 is used to denote thing have been done something to.
To use 把.
First, find out what exactly is the thing have been done something to. In your example, 我昨天賣了我的電腦給他. The thing(我的電腦) had been done something(賣了) to.
Second, put the thing after 把. 把我的電腦
Third, try to refill the semantics you have lost. 把我的電腦 is not complete to express what original sentence(我昨天賣了我的電腦給他) means. 我把我的電腦 我昨天把我的電腦 我昨天把我的電腦賣了 我昨天把我的電腦賣給了他.