The easiest way would be subscribing to the communities you want and then using the subscribed feed instead of the all feed
Some frontends (mostly the apps) have filters you can use to filter content but the main frontend doesn't currently apart from blocking the communities
An alternate thing to do could be to use the local feed in the instance that primarily has the content you want. Isnt doable for all types of content since not everything has a topic based instance for it and would require having a new account if you want to interact but theres things such as mander.xyz for science, programming.dev for programming/hardware/etc. topics, etc.
People interact with the site that dont have accounts on the site
Making it local only would lock them out of news and discussion about something they interact with