How to calculate PCA on raw MEG data

I have raw MEG data which is 4D-neuroimaging. How do I perform PCA on it?

Just like you would do with CTF or Elekta recordings:
https://neuroimage.usc.edu/brainstorm/Tutorials/ArtifactsSsp

If you haven’t followed the introduction tutorials yet, I recommend you start by following them (section “Get started” in the tutorials page) using the example dataset.