This module is in continuation of 2 blogs written before on removing payment method and removing shipping method only.
Here I am just going to attach the source files of the module, as this blog is just the combination of the previous two blogs. All explanation of the source code is already giving in the previous posts.
So attached is the module
Module Name: Checkout Remove Payment and Shipping Source
This is end result of the code