I have x guests for my wedding and y tables with z seats. Guest A can sit on the same table as guest B and guest C can not sit on the same table as guest D, ....
Given
This problem is NP-hard in the general case, so you shouldn't expect to find a general solution to it that's efficient if the number of tables or guests is large. This problem is a variation on this earlier problem which asks about divvying people up into different houses based on their preferences, and you can reduce that problem (which is NP-hard) to this one by simply giving each table enough capacity to hold every single guest.
If the number of people per table is small and the number of guests is small, you could just brute-force the solution by trying every possible assignment. Another option would be to try randomly guessing a few solutions and then incrementally modifying them to try to find a solution that works (for example, using a hill-climbing algorithm).
Hope this helps!