How to get the options of the configurable attributes for a configurable product?

Extended reading: How is a configurable options block rendered on a frontend product view page?

See also: