How can I switch from splitscreen to single screen and back again?

I need to briefly switch from a split-screen to a single screen and back again in my game, but I can’t find any way to do it. I found one tutorial using c++ but it didn’t work and broke my project.