Is this the correct/best way to create a custom column in mysql? I needed to select certain records from a selection with a custom column that have another column's modified value as its own value. The following query just works for my needs. But I wanted to know if it's the best/right way of doing this.

/* this is just OK */
SELECT column1,column2,SUBSTRING(column2,4) AS custom_column
FROM MY_TABLE
WHERE SUBSTRING(column2,4) = 'xyz'


Also, I saw I cannot simply say 

WHERE custom_column = 'xyz' /* error: custom_column doesn not exixts */ 


It would throw an error. That's because I used the syntax above instead. But it feels strange to me.
It is unclear whether the method in your example is right or best for you, but if you need to query or return the same expression in many different queries, you can add a custom column to the table itself. In MySQL, this is called a generated column:

ALTER TABLE
  MY_TABLE
ADD COLUMN
  custom_column VARCHAR(50) AS
  (
    SUBSTRING(column2, 4)
  )
;


This way the column will be available for reference in any part of any query on MY_TABLE:

SELECT
  column1,
  column2,
  custom_column
FROM
  MY_TABLE
WHERE
  custom_column = 'xyz'
;


A live demo of this approach is available at db&lt;>fiddle.uk.

On the other hand, if this is a one-off occasion where you simply need to be able to reference a calculated column in the WHERE clause of one specific query, then since MySQL 8 you can define such a column using a LATERAL join to a FROM-less SELECT. Once you have defined the column in this way, you can reference it by name in any part of the query, including the WHERE clause:

SELECT
  t.column1,
  t.column2,
  c.custom_column
FROM
  MY_TABLE AS t
  CROSS JOIN LATERAL
  (
    SELECT
      SUBSTRING(column2, 4) AS custom_column
  ) AS c
WHERE
  c.custom_column = 'xyz'
;


You can play with this method in another live demo.