Is it possible for Scotland to leave the United Kingdom? If so, how would it do so? What are the steps it would take?
Yes, it's possible.
Scotland can hold a referendum, however it would require the consent of the British Parliament for it to be legally binding as according to the Consultation on a Draft Referendum Bill issued by the Scottish government.
This is because these matters are known as "reserved matters" which the UK Parliament remains sovereign.
1.4 In the 2014 referendum, an Order in Council under section 30 of the Scotland Act 1998 was agreed by Westminster and the Scottish Parliament, recognising the mandate of the Scottish Government, and the support of the Scottish Parliament, for a referendum on independence. The Order put it beyond doubt that the Scottish Parliament could legislate for that referendum. If the Scottish Government decided to formally introduce this Bill to Parliament, it would be expected that a section 30 order would be sought and agreed, as in 2014.
In the meantime, it seems that the UK won't be giving the permission for Scotland to have a legally binding 2nd independence referendum.