We can use CAST() function to convert not only varchar to int but also from any type to another type.
This is the syntax to change datatype using CAST():
CAST( expression AS datatype (length))
Here is the example of how to convert from varchar to int:
SELECT CAST (‘1234’ AS INT);
You can check this SQL tutorial blog to understand datatype conversions with examples.