IF THEN ELSEIF ELSE ENDIF lets you express several conditions in order. The first true branch supplies the value. Put a missing-value rule before a comparison when the task gives missing data its own meaning. IIF is useful for a two-way decision, but it still needs an intentional output type and an explicit boundary.
Text and numeric functions solve different problems. ToString produces a label, ToNumber creates a numeric value, and Trim or Left prepares text without changing its business identity. Contains finds a substring and Regex_Replace applies a pattern replacement. A field that looks correct in the visible data can fail when the next record contains a null, a threshold value or a different prefix. Test those cases in the output rather than relying on how the expression reads.