I mean... did you even bother to look on the product page?
Right on
https://www.microchip.com/en-us/product/PIC24HJ128GP506#document-table (admittedly, under "documentation" which is a bit wrong), they have code examples to download. They're projects for the old MPLAB, which in theory you should be able to import into MPLAB X, but you may consider just installing the old MPLAB to verify that it can be set up correctly for your chip.
With that said, I certainly wouldn't use that chip if you're quite new to C programming. Configuring MCUs by hand is a pain in the butt, so a fully-supported dev board (like Arduino, ESP32, STM Nucleo, etc.) is probably a better place to start. Or at least a PIC that's supported by MCC. My very first exposure to anything PIC was on a board I designed (boss told me to use an 8-bit PIC so I chose one with peripherals that matched my application well) using the PIC16F18857. It worked perfectly, and with MCC getting it up and running was not hard at all. All the same, without some prior microcontroller experience (mostly Arduino and ESP32 under Arduino, plus some STM32), it would have been harder, since you still need to understand what it is you're configuring, even if it is done visually!