The most common cause of the sidebar appearing below the content is an HTML or CSS error breaking the layout.
Each in HTML needs to be properly closed. If the template responsible for displaying the page has an unclosed tag, then this would break the layout.
Apart from HTML, CSS also affects the overall design of every element on your WordPress website. It is used to define the width, alignment, and floating of elements in your layout.