To apply for a student visa, you must follow the proper procedures and adhere to the visa regulations. This includes applying for the visa while you are still in your home country or applying for a change of status if you are already in the United States with a different visa.
If you overstayed your tourist visa, you should consult with an immigration attorney or the nearest U.S. embassy or consulate to discuss your options and the steps you need to take to address your visa violation. Attempting to obtain a student visa while overstaying your visa without addressing the violation can further complicate your immigration status and make it more difficult to obtain the desired visa.