The GTX 745 and GTX 1050 Ti have similar power consumption, but the 1050 Ti does consume a little more power.
Check your power supply. Find out the model and see if it is up to the task.
You typically look at your CPU also to find out if it will be fast enough to take full advantage of a faster GPU.
As for installing the new GPU. Download and run Display Driver Uninstaller and select the "Clean and Shutdown" option. Do that and remove the GTX 745. Then insert the GTX 1050 Ti. Download and install the latest compatible driver from Nvidia and install it.