What Pixhawk Flight Controller Should I buy?

I am trying to build an autonomous drone. After doing some research, I decided to go with Pixhawk. Nearly all the tutorials I saw were based on the Pixhawk or Pixhawk 2.4.8. However, when I went to buy it, I saw it was discontinued and that they had many newer modules available, going all the way up to Pixhawk 6C mini. Which one should I buy? Can I use the newest models and the mini versions of them with existing tutorials? Or do I have to find a tutorial written specifically for the model I choose?

I saw this post from a year ago which said to buy the Pixhawk 5 because the Pixhawk 6 “hasn’t yet been produced by a manufacturer.” Is that still the case? If so, which one should I buy?

They also recommended in that post to go with and older model for now to get familiar with it. If I did that, would my existing code work if I got the newest model later?

Thanks.

Duplicate of What Pixhawk should I buy.