Doom Emacs has editor/fold module which makes folding code simple
Steps:
M-x +fold/toggle
C-c C-f C-f
Demo (folding a large hash in ruby):
ruby