Mortgage backed security (MBS) - Ex. You are a big investor and a finance company approaches you for a 100 million loan (bond) from you to expand their business. Then you ask for a security for the loan. Then the finance company offers you the money receivable from its retail customers on the finance facilities given to them as a security. That means if the Finance company doesn't pay you back, you have a right to claim the lease rentals paid by its customers. This is simply a MBS arrangement.
Credit Default Swap (CDS) - Now assume you gave the 100 million loan to the finance company but you still want to minimize your risk of default by the Finance company. Then you call another investor (B) ask him to bear this risk for a premium and he agrees. You pay a monthly premium to B for taking this risk. Now if the Finance company goes bankrupt, B is required to pay you for the loss while you transfer the ownership of the defaulted loan to B. This is a CDS arrangement. CDS is somewhat similar to an insurance arrangement.
BTW in 2020 Michael Burry predicted Tesla stock would collapse like the housing bubble and apparently he held puts on around 1 mil shares of Tesla. But it was not the case and Tesla price continued to rise and he should have incurred a huge loss on these puts.