You're not alone. The following places can connect you with people who can help you get back on track.
National Call Center For Homeless Vets (https://www.va.gov/homeless/)
Call (877) 4AID-VET (877-424-3838)
You'll be redirected to local resources. If you know your local VA, call them first. Most have emergency housing dorms and mental health resources.
Find a local organization (https://www.nchv.org/index.php/help/help/locate_organization/)
The National Coalition for Homeless Veterans has a search tool to find local resources in hundreds of locations. Use their interactive map to find one near you or call 1-800-VET-HELP. Their site also includes mental health resources.