What 妙脆角 has written is excellent. I'm just going to add some English to it because you might find such a long Chinese answer intimidating,
「怎么」vs「怎样/怎么样」 - 怎樣 and 怎麼樣 basically mean the same thing. 怎樣 is just a shorter and more spoken form of 怎麼樣. It can be translated as "how is it" or "what's it like?". 怎麼 on the other hand can be translated as "how", and is used differently.
1.问方式方法 When asking questions about how to do things
这个汉字怎么写?=这个汉字怎样写?
How do I write this character = (lit.) In what way do you write this character. Saying the first one is more common.
2.问原因 When asking about reasons/causes
他怎么不来?
How come he isn't coming?
3.惊奇地问
When you're surprised/taken aback at something
怎么,你今天就回去?
Huh? You're going back today? (This sentence implies that "you" is going back quicker than initially thought)
4.问性质情况(注意它们在句中的位置、用法)
When asking about "how" something is
①他身体怎么样?
How is he? (When asking about someone's physical condition/health) lit. He body how is it
②他学得怎么样?
This is hard to translate nicely, but it means "How is his studying going?". The person asking the question wants to know if the person studying is finding it hard or easy/whether they have made progress or not
③他是怎么(一)个人?=他是怎样的(一个)人? = 他是一个怎样的人?
What kind of person is he? The second and third sentences are more common
④怎么了?
This can be translated as "huh? What happened?" or "what's up?". For example, someone says something that you don't really understand, or something that you find surprising, you can reply 怎麼啦?And then ask "what happened?". Alternatively, you can ask 你怎麼了 or 你怎麼啦, which means "what's the matter?" or "what's up?"
5.问对方意见
When asking what the other person things of your idea/suggestion
我们一块去,怎么样?
Let‘s go together, what do you think? Lit. "Let's go together, how is it?"
6.用在反问句 When asking rhetorical questions
我怎么能不感谢你呢?
How could I not thank you?
7.引申用法
An extended meaning
不怎么=不太
Not too___
今天不怎么热。
It's not too hot today (informal spoken language only)