If your main objective is to debug your code, then, you’ll maybe find useful these tips:

Are you sure your labels are correct?
Did you try other learning rates? smaller? bigger?
Did you normalize your training data ?
Did you try other losses?

If your objective is to get something running and tweaking the architecture to achieve some specific results, I think you should try cloning a GitHub repo and reproducing the results the autor says he/she gets. For instance, I found this 1 repo that might be useful to you. Try running it and understanding what differs from your implementation. For instance, it seems the autor use a BCELoss instead of a custom loss function.