Adding a New ROS2 Node to A Package
Python Nodes
There are some really good tutorials online found here: Creating a ROS Node Tutorial, What is a ROS Topic, Creating a ROS Publisher Node, Creating a ROS Subscriber Node, and Combining a ROS Subscriber with a ROS Publisher.
This tutorial series is very good in general, and I would recommend looking at all the videos in the series although it is not strictly necessary.