I rarely eat meat. But when I feel like beef I will go for the tenderloin. Because it is so rare I get to eat this, I like to cook it plain so I can later pair it with a nice strong mustard or asian salad sauce.
There are 5 simple steps to a perfect result (for me that would be a medium rare):
Bring the meat to room T before cooking.
Oil the tenderloin very well, rubbing it all over it with your hands and salt it heavily, you want an almost crust like layer all around.
Heat a non-stick pan to the maximum. It should be smoking. Place the tenderloin in the pan and let it form a good sear, before turning it 90 degrees to do the same on the adjacent side. You should turn it at least 4 times so that the sear is even around the whole surface. The time needed on each side should be around 2 minutes. I also sear the top and bottom, using a pair of tongs to hold it.
Place in a hot oven, 180 - 200 degrees, whatever temperature you are used to working, and roast for at least 8 minutes for a medium rare result, or longer if you prefer it more cooked. The exact time will depend on the strength of the oven and on the size of the tenderloin. You can of course check the doneness with a thermometer, but you can also learn to do it by touch (check this trick out).
When it has reached your preferred doneness take it out of the oven and let it rest for at least 10 minutes. Do not cut it before it has rested well enough. You will see juices flowing out of it and when that stops your are good to go.
Cut it just before serving with a sharp knife.