If the other person is crying a lot, then I know that offering a hug
would be appropriate. So, I just open my arm to suggest a hug and wait
to know if the other person wants it or not.
As a non-verbal cue, that is about all you can do. The problem is that everyone has a different reaction to being hugged. If you look at other questions on this site you will see that some people hate to be touched. Other people love to be touched. Very often this comes from their family upbringing.
My thoughts on an alternative
I personally would be more likely to simply listen to their problems without feeling the need to comment much. However if they were a friend and I suspected they would like a hug, I would simply say, "You look really upset. Do you want a hug?"
They can then say Yes or No according to how they are feeling at the time. Either way you have left the decision to them.
A useful phrase might be, "I'm not very good at these things but I'm listening" meaning that you don't know what to say but you are sympathetic. If they know about your autism and you think it is appropriate you could say, "Because of my autism, I don't know what to say but I am sympathetic and I am listening"
If you don't know what to say then I suggest it is better to ask non-judgemental questions. Here are some examples.
You look really sad. What are you unhappy about?
What is it about that, that makes you most unhappy?
I'm not sure I fully understand. Could you explain?
How are you feeling now?
Non-judgemental means that you don't impose your opinion - you ask for theirs.
Note: The above are only sample questions. Their purpose is for you to understand how the other person is feeling and why they are feeling that way. None of us can mind-read what another is thinking so we can only know by asking.
The person may say, "I don't feel like talking" in which case it is best to stop asking
the above type of question. Maybe a good question at that point is, "Is there anything I can do to help you feel better?"
Finally, you don't have to do what they ask. If they ask for a hug then go ahead if you feel like giving it. If they ask you for something you don't want to do then you can say, "I'm not very good at that sort of thing but I'm here to give you moral support."
I have trained in NLP (Neuro Linguistic Programming) and something called Option Dialog. I have a lot of experience and of course I can't teach either here.
Asking non-judgemental questions is something of an art. I won't attempt to explain in detail.
There are two main versions of the Option Dialog(ue). They are similar. I have no financial or other connection with either. I make no recommendations and if you are interested I suggest learning from books and other printed matter rather than going on expensive courses.