Auto layout (Shift A): select an artboard or frame, or some layers, and choose Add auto layout in Properties. Layers are wrapped in a new frame first. The layers then sit in a row or a column, in their layer order, with the gap and padding you set. Direction and gap are read from how the layers sat, so they move as little as possible.
Spread places the layers from the start, centered, from the end, or with equal space between. Line up aligns them across: tops, middles or bottoms in a row. Hug width and Hug height make the frame fit around its layers; Fixed keeps the size you give it. Dragging a side of the frame sets it to Fixed on that side.
Inside an auto layout frame, a layer’s Resizing can be Fill width or Fill height, so it takes the space that is left (text can fill a width when it is Fixed width). Drag a layer along the row or column to change its place in the order. The minus button in the Auto layout section takes auto layout off and leaves the layers where they are.
Wrap onto more lines (rows of a fixed width): layers that don’t fit go onto the next line, with Gap between lines between them, and the frame’s height hugs the lines, as for a set of tags. Min and max sizes limit the size auto layout gives a layer or a frame when it fills or hugs; leave a field empty for no limit. A Fixed width text layer can Fill width.
Ignore auto layout (under Resizing) lets one layer in an auto layout frame be placed by hand, like Figma’s absolute position: the others close up around it, and it keeps its place by its Constraints when the frame changes size. Use it for a badge on a button or a close button in a corner.
Auto layout works in components too: a button whose label is changed in an instance grows to fit the new words.
Constraints: for a layer in an artboard or component, Constraints say what it does when that is resized: stay at the left, the right, both (stretch), the center, or scale; and the same for top and bottom. Resizing an artboard by dragging or in W and H follows them. Hold Ctrl or ⌘ while dragging to resize the artboard alone. Instances follow their component’s constraints when they are resized.