When I first started with Pico-8, I started with two tutorial series regarding the code, one a lot simpler than the other. I don't see either of these linked in those posts so here they are:
First start with this video. It's only two parts, and it teaches everything through good habits. Specifically, it talks about states, about functions, and also goes over generally how to actually operate the Pico-8 program a little bit.
Then go through this tutorial series. It's a lot longer and goes into greater depth. It goes into instance creation, tables, the sfx editor and other more advanced things that you'll need to know.
In addition to code, there's also the SFX editor and music tracker. Matt Tuttle made four very helpful videos on the subject. Here is the first, and you should be able to find the other three videos in his series.