Need help making a custom firmware for tplink-wr940n v6 to free upsome space

There's an online builder here: Online ImageBuilder and Upgrade Server

You can remove some of the packages that are listed in the drop down box. If you want to remove more you add them with a minus sign in front, for instance -opkg. See this page: https://openwrt.org/faq/before_installation#which_packages_can_i_safely_remove_to_save_space

If you want to do more, like adding zram swap or increasing the block size to get better compression, you can use this guide: https://openwrt.org/docs/guide-user/additional-software/beginners-build-guide