How would I go about making my clean PC connect to LAN only and allow a program?

Basically, what I need to do is set up my ENTIRE PC to only connect to LAN, HOWEVER allowing a specific program to connect to the internet. How would I go about doing this? Thanks!