Yes. You give the deposit to the landlord. The landlord lodges it with one of the deposit protection schemes.
If they [fail to register your deposit, you can get 3 * the amount back](https://www.mygov.scot/tenancy-deposits-tenants#:~:text=If%20your%20landlord%20doesn't,(Housing%20and%20Property%20Chamber).)