I was told that short sentences can be used to emphasize important points while longer sentences an be used to provide context and support, but if you decide to do so, should you stay consistent or is it still ok to use longer sentences to emphasize important points in some situations? I wonder if staying consistent is important or whether it can have a very detrimental effect.
You are entering into the complicated concept of writing style. Also called "voice" and various other things.
There are many types of style. You choose the style to achieve the effect you want.
One style for narration is the omniscient "author" point of view (POV). This is a voice "from off stage" that knows everything, and your reader is intended to accept as The Truth. Usually this voice should stay uniform through the story. However, it's not a rule cast in stone.
Particularly when you are writing dialog, you pick the style that will reflect what you want the character to be. A university prof will speak very differently to a bartender. A police officer will speak very differently to a medical doctor. A green grocer will speak very differently to a banker. And so on. They will have different themes, different vocab, different attitudes, different things that frequently show up in their conversation.
Your narrator can be first-person from the point of view of one of the characters. If that's the case, you usually want that to advance that character. So if the narrating character is a particular type of person, your narration should correspond to that. If, for example, your main character was a street orphan with zero formal education. You would probably not want them to be using quotes from ancient authors one only reads about in classics classes at university.
If your narrator goes through major changes during the story (and it's often an interesting thing for that to happen) then possibly you want their narration style to change in step.
When you are writing the narrator character you can have some fun. When you have a particular character "on stage" (or even nearby) you can let that character's style merge into the narrator's style. Particularly in action scenes. So you might have the descriptions be very different when (the Lord of the Rings character) Gollum is alone on stage as to when Elrond is alone on stage. Think of it in movie terms like the background music that plays when a particular character is on screen.
This can be a tad confusing, though. If you are jumping the narrator from one POV to another, the reader can get lost. You need to be selective when you do it, and to make it memorable and interesting so your readers pay attention.