Public keys identify wallets. Key X tries to double spend, it is detected, proof propagates across network, nodes vote to insert into the consensus ledger a public record that key X has been "dis-trusted". The network thenceforth rejects transactions from wallet identified by key X.
Bitcoin is "trustless". There is no trust of any form.