It is usually the case that when the S&P 500 index (SPX) goes up, the VIX goes down, and when the SPX goes down, the VIX goes up. This is because the VIX is a measure of fear the market. When the market goes up, there is usually less fear, and when the market goes down, there is usually more fear.
But the SPX and VIX do not always have an inverse relationship. On some days, both the SPX and VIX will move in the same direction. I have seen SPX go up on days when the VIX went up as well. Sometimes this occurs the day before a big event that will impact the markets (such as a U.S. government shutdown deadline or a monthly jobs report), and investors become nervous and are willing to pay more for options (which causes the VIX to increase). I have also seen the VIX go down on days when the SPX went down as well. Sometimes this occurs when bad economic news is released, but investors don't think the news is as bad as expected, so option premiums plummet (which causes the VIX to decrease).