Enable Linux support
Navigate to chrome://os-settings, and scroll down to Developers and turn on Linux development environment. ChromeOS will take some time downloading and installing Linux.
Start a Linux terminal
Press the Search/Launcher key, type "Terminal", and launch the Terminal app.
To install Flatpak, run the following in the terminal:sudo apt install flatpak
A more up to date flatpak package is available in the Debian backports repository.
Add the Flathub repository
Flathub is the best place to get Flatpak apps. To enable it, run:flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
To complete setup, restart Linux. You can do this by right-clicking terminal, and then clicking "Shut down Linux". Now all you have to do is install some apps!
Flatpak applications can be installed on ChromeOS with the Crostini Linux compatibility layer. This is not available for all ChromeOS devices, so you should ensure your device is compatible before proceeding. A list of compatible devices is maintained here.