The actual proper meaning of "whatever" is related to a choice between things.
Rena and her friend Beth are having tea at a cafe:
Rena: "What kind of tea do you want to order? They have matcha, mint and lemon.
Beth: "Whatever kind of tea you like; I'll order the same one."
Beth uses "whatever" to express that she has no preference in the choice of teas.
In the slang usage of "whatever" sentences are shortened.
Beth:"What art gallery do you want to go to later?"
Rena:"Oh, I don't care, whatever." (shortened)
Rena:"Oh, I don't care, whatever art gallery you like is fine with me." (full)
Usually in the slang usage of "whatever" the meaning is connected to the context in which its being said.
Lana is talking to her brother Bruce:
Lana: "Look at the new shirt I got."
Bruce: "it's nice but I thought you didn't like pink shirts"
Lana: "it's not pink; it's light orange.
Bruce: "No, it's pink"
Lana: "it's not pink!"
Bruce: "Lana, It's a pink shirt."
Lana is mad so she leaves the room. She said "whatever" in a very angry way.
What she meant when she said "whatever" was: "ok, you're, right, I don't want to argue anymore so whatever you think is right is right"
She didn't believe Bruce was right, she just wanted to stop arguing.
Sometimes people say "whatever" or "ok, whatever" when they're angry.
Even though it's common to do; it's considered rude to say "whatever" when you're frustrated or angry in a conversation.
People can also say "whatever" when they're surprised by a choice or behavior.
Rena: "My little sister told me she's going to stop eating cheese."
Beth:" What? I thought she loved cheese."
Rena: "She does! When she told me I was like 'ok, whatever'."
Rena is saying "ok, whatever" to mean: "I'm surprised that you want to stop eating cheese but you can do whatever you want to do."
The best way to understand the meaning of "whatever", each time its said, is to pay close attention to the context in which its being said.