Look at this existing tutorial https://lerryws.xyz/posts/PyQGIS-in-Jupyter-Notebook
cd yourdir
python3 -m venv venv --system-site-packages
source venv/bin/activate
pip install -U notebook jupyterlab
Run the virtual environment
cd yourdir
source venv/bin/activate
jupyter-lab
Then, create a Python 3 notebook (or open it if already existing), copy/ paste the following and run the notebook
import sys
import os
import qgis
from qgis.gui import *
from qgis.core import *
from qgis.utils import plugins
from PyQt5.QtCore import *
from qgis.analysis import QgsNativeAlgorithms
sys.path.append('/usr/share/qgis/python/plugins/')
sys.path.append('/usr/share/qgis/python/')
QgsApplication.setPrefixPath('/usr', True)
app = QgsApplication([], False)
app.initQgis()
import processing
from processing.core.Processing import Processing
Processing.initialize()
QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())
for alg in QgsApplication.processingRegistry().algorithms():
print(alg.id(), "--->", alg.displayName())
# Stop QGIS appllication
app.exitQgis()
app.exit()