Protect a Home Server from DDOS

Hello, someone from the community can give a free solution to protect a home server from DDOS attack.

I will buy a mydomain.com to publish server info and redirect from server.mydomain.com to my home server dynamic ip.

suggestion, ideas, orientation is welcome thanks!

You can get free protection for a website but not a game server. This is the main downside of running a home server.

Seems way more convient to just rent a server anyway. Unless you got free energy and pc parts laying around.

Not sure about all this DDOS stuff so please do not laugh if say something stupid but as I know if you need to enable (have DDOS) protection at home you can't just get it it like plan or something bonus for the IP/Domain like you do with the website because they are not on your PC, you need to have it from your ISP soo you need to find good Internet Provider that's made for commercial (business use, not home use) and they might offer you good internet speed + ddos protection.