Suppose you want to load products by using the SKU, it is very simple and you can get it by using the code below. There are many ways to do it, in this post I have given the code which works for me in most of the cases.