ASCII files are essentially text files that contain special character encoding scheme and are often used for so called ASCII art, i.e., images made with the use of letters and other symbols. You do not convert text files to ascii, you just rename the extension.
However, you may have also been looking for a way to convert a text into ASCII number format, in that case you have to use a special conversion utility for this purpose. The resulting file will contain just numbers that are assigned to each symbol from the original text file.
There is also the option in some better text editors to change the encoding of the text file, for example from UTF-8 to ASCII etc. In this case you have to save your text file with a specific encoding. Some text editors feature "Save with encoding" function that is exactly for this purpose.
Updated: June 23, 2023