This is documented at: DirectX Graphics Infrastructure (DXGI): Best Practices and further discussed at DXGI Overview: Care and Feeding of the Swap Chain.
There are 3 basic calls involved, as follows:
This is used to switch between fullscreen and windowed modes; if you're not switching (i.e you're going from a fullscreen to a fullscreen mode, or from a windowed to a windowed mode) you don't need it.
In a fullscreen mode this changes the display resolution; in a windowed mode this changes the size of the window. However it doesn't resize any of the underlying D3D objects (such as your backbuffer, your depth/stencil buffer, etc), so for that you need:
This will resize the backbuffer to match either an application-provided size or the size of the client rect of your window, depending on parameters you specify. It will not resize your depth/stencil buffer.
To resize your depth/stencil buffer you should destroy it and recreate it. You already have the code needed to destroy it in your program's shut down code, and you already have to code needed to recreate it in your program's startup code, so it's highly recommended that you reuse those.
You will also need to reset your viewport manually, as well as manually recreate any render targets you're using which need to match the window size/video mode.
It's also highly recommended that you read the first two links I've provided very carefully, as well as the individual documentation for each call. There are some corner-cases where things may not work as you expect (it's best to ask separate questions about them if you run into them) and DXGI will operate in one of two modes: either it will handle most things automatically for you (but it may not do so the way you want) or you will have to do all the work yourself, depending on if you've used IDXGIFactory::MakeWindowAssociation or not.
My recommendation is to not put this code into your own program just yet. Instead make a standalone program that just draws a black screen, and work through mode changing in that until you have a good understanding of what needs to be done and when and how to do it.
DXGI has it's own logic and if you use it the way it was designed to be used you'll do fine; if you try to fight against it or try to shoe-horn a different way of working onto it, you'll create a mess. It's best to have that learning experience in a separate program.