Bitcoin
How do nodes retrieve unconfirmed transactions?

I’m starting a project to build software in Python to mine cryptocurrency (preferably Bitcoin). Here’s an overview of the calculations that need to be done:
I would like to know how a node can get unconfirmed transactions.