For magit, I like having it display full screen (deleting other windows), and then on quitting restore to the windows/splits I had before:
(setq magit-display-buffer-function 'magit-display-buffer-fullframe-status-topleft-v1)
(setq magit-bury-buffer-function 'magit-restore-window-configuration)
For more general display-buffer tweaks, OP has a whole article on it https://www.masteringemacs.org/article/demystifying-emacs-wi... (though for display-buffer I just stick to the defaults myself, never tried CIDER)