Cutting a piece out of a cell means knowing where the piece starts. The FIND function answers that question with a number you can hand straight to another formula.
It is not a search box. What comes back is a position, counted from the first character, and the whole point is that something else consumes it.
For example, a product code with a dash in it has no fixed layout at all. Locate the dash and every cut after that becomes reliable, whatever length the codes happen to be.
The FIND function.
So tell it what to look for and where to look.
=FIND("XL",A2)The answer counts from one, so 8 means the eighth character. In short, the FIND function reports a position and nothing else, which is exactly what MID was asking for.
Feed it straight into a cut and the two work as one formula. =MID(A2,FIND("-",A2)+1,3) takes three characters from just past the dash, wherever the dash happens to be.
Case matters, and so does absence.
Two surprises wait here and they are really the same surprise. First, the match is case-sensitive, so "XL" never matches a lowercase xl.
=IFERROR(FIND("XL",A2),0)Second, missing text is an error rather than a zero. You get #VALUE!, which propagates into whatever formula was waiting for the number, so a single absent dash can redden a whole column.
SEARCH is the forgiving sibling. It ignores case and accepts wildcards, though it costs you the strictness that makes FIND worth using on codes where case carries meaning.
Result of the FIND function.
Before. Three codes and two empty position columns.

After. The two functions side by side, agreeing on one row and parting company on the next.

A2 -> AB-482-XL
A3 -> CD-917-xl
A4 -> EF-7-M
=FIND("XL",A2) -> 8
=FIND("XL",A3) -> #VALUE! (lowercase xl)
=SEARCH("xl",A3) -> 8
=FIND("XL",A4) -> #VALUE! (genuinely absent)
=IFERROR(FIND("XL",A4),0) -> 0Notice that the middle row separates the two behaviours. The text is there, so absence is not the problem; only the capital letters are, and that is the distinction the last row removes.
Wrap it in IFERROR once you know which rows can legitimately miss. Then hand the position to MID and the pair does the whole job.