Here is an article from May 2020 about 15 drugs [1], including hydroxychloroquine and ivermectin, that were being looked into to see if they might help COVID. It goes into the mechanisms that led researchers to believe they were worth looking at.
[1] https://www.nature.com/articles/d41591-020-00019-9
Edit: Oops...forgot to link the article. Added.